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

Commented Unassigned: Cannot call base package functionality in r [116]

$
0
0
Hi!

I have installed R.NET version 1.5.12, also tried version 1.5.11. I am simply trying to make the simple eample with the t-distribution test work.

Simple operations work fine, such as

NumericVector group1 = engine.CreateNumericVector(new double[] { 30.02, 29.99, 30.11, 29.97, 30.01, 29.99 });
engine.SetSymbol("group1", group1);
// Direct parsing from R script.
NumericVector group2 = engine.Evaluate("group2 <- c(29.89, 29.93, 29.72, 29.98, 30.02, 29.98)").AsNumeric();

But as soon as this row is executed:

GenericVector testResult = engine.Evaluate("t.test(group1, group2)").AsList();

There is a runtime error saying:

RDotNet.EvaluationException
{"Error: could not find function \"t.test\"\n"}

If I change the above call to

GenericVector testResult = engine.Evaluate("stats:::t.test(group1, group2)").AsList();

I get another that the stats.dll shared library cannot be loaded?!!

I currently have R for windows version 3.0.3 installed. Also tried with 3.1.0... Same result!

What is the issue here - am I doing something wrong? Quite unlikely since I just followed the example in the documentation.. ?

My machine is a brand new Win 7 64-bit.

Comments: For reasons yet to be fully understood, on some Windows machines the R_HOME directory cannot be successfully found. It probably varies between machine setup too; I think I got this issue with two parallel R installations. You can find what the default initialization procedure uses for the R lib and home paths with: ``` C# using RDotNet.NativeLibrary; // ... string rLibPath = NativeUtility.FindRPath(); Console.WriteLine("NativeUtility.FindRPath returns {0}", rLibPath); string rHomePath = NativeUtility.FindRHome(rLibPath); Console.WriteLine("NativeUtility.FindRHome returns {0}", rHomePath); ``` If these look odd, incorrect, missing, you can force the paths prior to calling REngine.Initialize, specifying parameters for SetEnvironmentVariables ``` C# // class REngine public static void SetEnvironmentVariables(string rPath = null, string rHome = null) ```

Viewing all articles
Browse latest Browse all 1634

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>