Serving the Quantitative Finance Community

 
User avatar
balajian
Topic Author
Posts: 0
Joined: April 13th, 2005, 5:26 am

R and C++,C# etc.

January 11th, 2008, 2:28 pm

Is it possible to call R methods from languages like c++,C# etc. ?
 
User avatar
msperlin
Posts: 5
Joined: July 10th, 2006, 6:21 pm

R and C++,C# etc.

January 11th, 2008, 3:47 pm

QuoteOriginally posted by: balajianIs it possible to call R methods from languages like c++,C# etc. ?I know that you can run a R routine by calling them from a C++, but, for using R functions directly in C++ I'm not sure if exists a link for that.One trick you can use for artificially use R functions at C++ is to use .txt (or .csv) files for exchange data between a R routine and C++. That way you can use data from C++, input it at a R function and get the output. But, if you're dealing with a large scale system, that possibly a bad solution..
 
User avatar
eredhuin
Posts: 3
Joined: July 14th, 2002, 3:00 am

R and C++,C# etc.

January 11th, 2008, 5:07 pm

R is scriptable. Very easy.That means msperlin's text idea works just fine, as long as you are comfortable in a unix-style world of command lines and text files.If you're looking for windows automation, check the FAQ, q 2.18:R FAQ
 
User avatar
rwinston
Posts: 0
Joined: February 15th, 2007, 5:48 pm

R and C++,C# etc.

January 13th, 2008, 4:08 pm

It's very easy to call the R API directly from C/C++ - a lot of R extensions do this. Just include the relevant R header files. All the information you need is in the "Writing R Extensions" document on CRAN.
 
User avatar
dandare
Posts: 0
Joined: February 12th, 2008, 4:13 pm

R and C++,C# etc.

February 12th, 2008, 4:37 pm

Here you go: