R.Net data type and C#

Jun 16, 2014 at 11:22 AM
Hi All,

If I run

var e = engine.Evaluate("x <- 3")


NumericVector x = engine.GetSymbol("x").AsNumeric();

I can't use neither e nor x for further calculations in C#, for example

var y = e + 4* x

What can/shall be done to have R.Net output usable for C# calculations. Thank you.
Jun 16, 2014 at 11:00 PM
NumericVector and other similar classes do not have overloaded operators indeed. Worth considering in a future release, but not obvious.

One converts R vectors to C# "equivalents" with ToArray():
double[] x = engine.GetSymbol("x").AsNumeric().ToArray();
Jun 17, 2014 at 6:51 AM
jperraud, I appreciate your prompt and helpful feedback. Thank you.