Note that there are some explanatory texts on larger screens.

plurals
  1. POattempting to connect to R from C#
    primarykey
    data
    text
    <p>I am trying to connect to R using C#. I installed R.Net and referenced it my project. This is my first attempt at C#. Any ideas what I am doing wrong?</p> <p>This is the sample C# code:</p> <pre><code>using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using RDotNet; namespace RNet_Calculator { public partial class Form1 : Form { // set up basics and create RDotNet instance // if anticipated install of R is not found, ask the user to find it. public Form1() { InitializeComponent(); string dlldir = @"C:\Users\R\R-2.15.2\bin\x64"; bool r_located = false; while (r_located == false) { try { REngine.SetDllDirectory(dlldir); REngine.CreateInstance("RDotNet"); r_located = true; } catch { MessageBox.Show(@"Unable to find R installation's \bin\i386 folder. Press OK to attempt to locate it."); } } } } } </code></pre> <p><img src="https://i.stack.imgur.com/RGoeO.png" alt="enter image description here"></p> <p><img src="https://i.stack.imgur.com/6Q3xO.png" alt="enter image description here"></p> <p>this is the Program.cs:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace Form1 { static class Program { /// &lt;summary&gt; /// The main entry point for the application. /// &lt;/summary&gt; [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload