This project is read-only.

R.NET couldn´t find function in VB

May 5, 2016 at 10:13 AM
I need use R in my ASP application. I am using RDotNet library and I need the T.TEST function of R. The code where I work with R:
Dim listNPS AS string="c <- (1,-1,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,-1)"
Dim listPeriodo AS string="c <- (1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0)"

Dim engine As REngine = REngine.GetInstance
Dim NPS As NumericVector = engine.Evaluate(listNPS).AsNumeric
Dim Periodo As IntegerVector = engine.Evaluate(listPeriodo).AsInteger

Dim testResult As GenericVector = engine.Evaluate("t.test(NPS, PERIODO)").AsList
Dim test_t As Double = testResult("p.value").AsNumeric().First()

The error I obtain is "Couldn't find function t.test"

I've executed the t.test in the .exe where my R is installed and it works ok. I don't know if it could be an error about REngine.SetEnvironmentVariables() but if I indicate the RHOME and RPATH it doesn´t work in that instruction:
Dim rhome As String = "C:\Program Files\R\R-3.2.5"
Dim rpath As String = "bin\i386"
Dim ruta As String = Path.Combine(rhome, rpath)
Thanks everyone!