```
public static double TestOtherR()
{
engine = REngine.GetInstanceFromID("RDotNet");
if (engine == null)
{
var envPath = Environment.GetEnvironmentVariable("PATH");
var rBinPath = @"C:\Program Files\R\R-3.0.1\bin\i386";
Environment.SetEnvironmentVariable("PATH", envPath + Path.PathSeparator + rBinPath);
engine = REngine.CreateInstance("RDotNet");
engine.Initialize();
}
// .NET Framework array to R vector.
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();
//return group2.Last();
GenericVector testResult = engine.Evaluate("t.test(group1, group2)").AsList();
double p = testResult["p.value"].AsNumeric().First();
return 1.0;
}
```
that's my test code,it runs perfectly on my web server debugger,but on iis, it throws ParseException on the line
```
GenericVector testResult = engine.Evaluate("t.test(group1, group2)").AsList();
```
the line before is all good.
help me please
Comments: I'm not sure about multithreading, but I had issues with permissions under ASP.NET WebAPI 2. In my case, I R would fail to load libraries (stats), or external dlls (lapack, blas). In built functionality in R would work fine, ie: basic math, print, etc..., but those items would fail. I tried the usual things for permissions: Adding IUSRS to folder, running the app pool as Local System, running under a user account, but load library would fail. When I moved the REngine host to an external WCF service running under my local user account, and forwarding, everything worked fine. Attached is a screenshot of the R code you supplied running under rdotnet 1.5.11 via ASP.Net WebAPI 2 and the WCF service.
public static double TestOtherR()
{
engine = REngine.GetInstanceFromID("RDotNet");
if (engine == null)
{
var envPath = Environment.GetEnvironmentVariable("PATH");
var rBinPath = @"C:\Program Files\R\R-3.0.1\bin\i386";
Environment.SetEnvironmentVariable("PATH", envPath + Path.PathSeparator + rBinPath);
engine = REngine.CreateInstance("RDotNet");
engine.Initialize();
}
// .NET Framework array to R vector.
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();
//return group2.Last();
GenericVector testResult = engine.Evaluate("t.test(group1, group2)").AsList();
double p = testResult["p.value"].AsNumeric().First();
return 1.0;
}
```
that's my test code,it runs perfectly on my web server debugger,but on iis, it throws ParseException on the line
```
GenericVector testResult = engine.Evaluate("t.test(group1, group2)").AsList();
```
the line before is all good.
help me please
Comments: I'm not sure about multithreading, but I had issues with permissions under ASP.NET WebAPI 2. In my case, I R would fail to load libraries (stats), or external dlls (lapack, blas). In built functionality in R would work fine, ie: basic math, print, etc..., but those items would fail. I tried the usual things for permissions: Adding IUSRS to folder, running the app pool as Local System, running under a user account, but load library would fail. When I moved the REngine host to an external WCF service running under my local user account, and forwarding, everything worked fine. Attached is a screenshot of the R code you supplied running under rdotnet 1.5.11 via ASP.Net WebAPI 2 and the WCF service.