[R] Call R program from C++ code

Dirk Eddelbuettel edd at debian.org
Mon Jul 30 01:28:12 CEST 2007

On Sun, Jul 29, 2007 at 07:15:21PM -0400, Feng Qiu wrote:
> >>using the system() call -- but it is also the most tedious way as you
> When using System() to call R program, do I need to call some R script
> program or my R function directly? 

It's system() with lower-case s, and yes, you would call some script
to process the input you prepared from C++. And the script would
prepare output that your C++ program would need.

> >> A more advanced method would to use Rserve to run a 'headless' R	
> Here you mean Com? I don't know much about this com frame, so ....

No, I did not mean Com. 

Rserve uses tcp/ip networking and is agnostic to the operating system
of the caller, ie your (say, Windoze) program can call and exchange
(binary) data with a program on a Linux box or Mac that runs Rserve.
Could also be Windows, could be the same computer, or could be a
different one. Rserve is quite flexible that way.


Three out of two people have difficulties with fractions.

More information about the R-help mailing list