Does not contain a definition for 'EagerEvaluate'

Oct 9, 2014 at 3:15 AM
Hi All,
 I'm trying some sample codes in R.NET and planning to use it for an existing script. But I'm stuck with the following error
Error 'RDotNet.REngine' does not contain a definition for 'EagerEvaluate' and no extension method 'EagerEvaluate' accepting a first argument of type 'RDotNet.REngine' could be found (are you missing a using directive or an assembly reference?)
I've added the reference for RDotNet version 1.5.5 from NuGet and tried using VS 2012 and 13. The R version used is 3.0.1.

Hope this helps. Thanks in advance!

The used code
 private void button1_Click(object sender, EventArgs e)
        {
            string rhome = System.Environment.GetEnvironmentVariable("R_HOME");
            if (string.IsNullOrEmpty(rhome))
                rhome = @"C:\Program Files\R\R-3.0.1";
            System.Environment.SetEnvironmentVariable("R_HOME", rhome);
            System.Environment.SetEnvironmentVariable("PATH",System.Environment.GetEnvironmentVariable("PATH"));

           REngine.SetDllDirectory(@"C:\Program Files\R\R-3.0.1\bin\i386");

           using (REngine engine = REngine.CreateInstance("RDotNet"))
           {

            try
            {
                // import csv file
                engine.EagerEvaluate("dataset<-read.table(file.choose(), header=TRUE, sep = ',')");
 
                // retrieve the data frame
                DataFrame dataset = engine.EagerEvaluate("dataset").AsDataFrame();
 
                for (int i = 0; i < dataset.ColumnCount; ++i)
                {
                    dataGridView1.ColumnCount++;
                    dataGridView1.Columns[i].Name = dataset.ColumnNames[i];
                }
........................
Developer
Oct 9, 2014 at 3:27 AM
The methods you are trying to use are obsolete and have been removed. R.NET 1.5.5 is superseded by newer versions hosted at https://www.nuget.org/packages/R.NET.Community

Follow the documentation at https://rdotnet.codeplex.com/documentation, which will refer to new NuGet locations and the current API.

See also previous discussions WRT R.NET versions, for instance https://rdotnet.codeplex.com/discussions/561524
Oct 10, 2014 at 8:20 AM
Edited Oct 10, 2014 at 8:21 AM
Thank you jperraud! Works fine.
Sometimes when I try to debug the program just stops after
  REngine engine = REngine.GetInstance();
 private void button1_Click(object sender, EventArgs e)
        {

>             REngine engine = REngine.GetInstance(); doesn't proceed after this line
            engine.Initialize();

            var topic1Scores = new string[] { "U", "U", "E", "D", "C", "B", "B", "A", "A", "A*" };
            var topic2Scores = new string[] { "U", "E", "D", "D", "C", "B", "A", "A", "A*", "A*" };
            var topic3Scores = new string[] { "U", "U", "U", "U", "U", "U", "U", "U", "U", "A*" };
            var topic4Scores = new string[] { "U", "E", "E", "D", "C", "B", "A", "A", "A*", "A*" };
            var topic5Scores = new string[] { "U", "U", "E", "D", "C", "B", "B", "A", "A", "A*" };


..........................................

 engine.Dispose();
May I know the reason and steps to overcome? I apologize if it is a silly question which I'm not aware of.


Thank you !