Sergei
Sergei

Reputation: 1637

Integrating C# and R problems

I ma trying to use R language inside of C# application.

I have followed the instructions here - http://joachimvandenbogaert.wordpress.com/2009/03/26/r-and-c-on-windows/ and I can succesfully connect to R server via COM. But when I try to get the result of an operation I get null instead of a value:

connector.EvaluateNoReturn("x <- c(2,3,5,1,4,4)");
var result = connector.Evaluate("sum(x)"); // it is always null here

I wonder what else should I check? I've set compilation mode to X86 for my VS project/solution. I have pointed all Environment variables to i386 subfolder of bin folder, but nothing helps.

I have Win7 64bit, R version 2.15.0. Maybe I should try 64bit R instead?

Upvotes: 2

Views: 3062

Answers (3)

j-m
j-m

Reputation: 1554

There is another SO post you may want to check out, How can I access Windows COM objects in R v3?.

But really, shameless plug, R.NET has made some inroads since this original post and the comments of Dieter Menne, including on *nix platforms. Readers of this post needing .NET and R interop may want to give it a try.

Upvotes: 0

Suraj
Suraj

Reputation: 36587

Along the lines of Oliver's answer, you could try RserveCLI2 a fork of Oliver's project.

Upvotes: 0

Oliver M. Haynold
Oliver M. Haynold

Reputation: 31

Some shameless self-promotion: There's also RserveCLI, yet another library to access Rserve from .NET. I presented it last year at the R/Finance conference, and there seems to be a small user base.

Upvotes: 3

Related Questions