Your code works! Now I learned how to link the library and call functions in R. I also learned how to pass the results back to .NET.
To make this works in my .NET application, I need to pass the data (double array, or double list) to sn lib as input (not load from a file):
Thanks
To make this works in my .NET application, I need to pass the data (double array, or double list) to sn lib as input (not load from a file):
void foo(List<double> myData)
{
var Y = myData;
e.Evaluate("fit <- msn.mle(y=Y, opt.method='BFGS')");
var beta = engine.Evaluate("fit$dp$beta").AsNumericMatrix();
......
}
When my data is passed from Y in .NET to y in sn, it causes an following error:"Error in is.data.frame(frame) : object 'Y' not found
A first chance exception of type 'RDotNet.ParseException' occurred in RDotNet.dll"
Could you please advise me on how to pass the observed data to sn lib?Thanks