Quantcast
Channel: R.NET
Viewing all articles
Browse latest Browse all 1634

New Post: Library in a different folder in vb

$
0
0
I cannot reproduce your issue. the code below, for a standard user with drc in the personal library folder, works.

The script below outputs, as expected from a session in RGui:
7
C:/Users/joe/Documents/R/win-library/3.0
C:/Program Files/R/R-3.0.0/library
            // Set the folder in which R.dll locates.
            var envPath = Environment.GetEnvironmentVariable("PATH");
            var rBinPath = @"C:\Program Files\R\R-3.0.0\bin\i386";
            Environment.SetEnvironmentVariable("PATH", envPath + Path.PathSeparator + rBinPath);
            using (REngine engine = REngine.CreateInstance("RDotNet"))
            {
                // Initializes settings.
                engine.Initialize();
                engine.Evaluate("library(drc)");
                engine.Evaluate("?drc::actimL");           // Note: Interesting this does not trigger firefox...
                engine.Evaluate("ryegrass.LL.4 <- drm(rootl~conc, data=ryegrass, fct=LL.4())");
                var blah = engine.Evaluate("backfit(ryegrass.LL.4)").AsNumericMatrix();
                Console.WriteLine(blah.RowCount);
                var libPaths = engine.Evaluate(".libPaths()").AsCharacter().ToArray();
                foreach (var item in libPaths)
                    Console.WriteLine(item);
            }
hope this still helps.

Viewing all articles
Browse latest Browse all 1634

Trending Articles