This project is read-only.

NullRefernceException was unhandled

Jan 3, 2013 at 1:05 PM

i have this problem with this simple code for connecting to R via c#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RDotNet;

namespace testR
{
    class Program
    {
        static void Main(string[] args)
        {
            REngine.SetDllDirectory(@"C:\Users\Documents\R\R-2.15.1\bin\i386");
            REngine.CreateInstance("RDotNet");
            REngine engine = REngine.GetInstanceFromID("RDotNet");
            NumericVector g = engine.EagerEvaluate("g <-c(29.89, 29.93, 29.72, 29.98, 30.02, 29.98)").AsNumeric();
            GenericVector result = engine.EagerEvaluate("summary(g)").AsList();
            Console.WriteLine(result);
            Console.WriteLine("test de connexion avec R");
            Console.ReadKey();
        }
    }
}
 at the seconde line: 

REngine.CreateInstance("RDotNet");
have you any idea why i have this problem.
thank's
Jan 4, 2013 at 4:56 PM
Edited Jan 4, 2013 at 4:57 PM

Which version of RdotNet are you using?  1.4?  1.5?

 

Jan 4, 2013 at 10:12 PM

hello

i am using the version 1.4 of R.Net,

have you any idea why i have this problem??

Jan 5, 2013 at 7:07 PM
Edited Jan 5, 2013 at 7:07 PM

Alex,

One last question I forgot to ask:  Have you been succesful in running the example code (Program.cs (v1.4)) on the home page?  I would recommend getting that working first and then moving on to your specific example.

Have you added the reference to the dll in your project?

Jan 6, 2013 at 3:27 PM

hello mjl13,

i tried the exemple  (Program.cs (v1.4)) but i have an error: it cant  find the Rlapack.dll,, try to reinstall the programm,

for adding the refernce of R.net i do right click on the solution after add an referenc after the location where my Rnet.dll exist,

i tried with the V1.3 and i put all the R dll files in the debug directory of my project and it works ???