[R] Calling R from C++ application

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jun 6 19:22:09 CEST 2001


On Wed, 6 Jun 2001, Alexander Kirillov wrote:

> Hi,
>
> I am trying to figure out if it's possible
> to use R as a computational engine
> for a C++-based windows application.
>
> What I would like to do (from my C++ program)is:
> - start R
> - send some data from my program to R
> - execute R program
> - get data back to my application
> (I was able to implement all this for
> Matlab.)
>
> I looked at Chapter 4 of "Modern Applied
> Statistics with S-plus" by Venables and Ripley
> (Springer, 1996) and stumbled on a statement:
>
> "Note that it is only possible to call S functions
> from within C functions called from S..."
>
> Is this still true for the latest version of R?

No.

> If not, is there a place where I can look at the
> sample code that calls R?

Two choices:

The DCOM interface by Thomas Baier, on CRAN under
Software->Other->Non-standard packages

Use an alternative front end:  src/gnuwin32/front-ends/readme.

Both have examples in C.  The first is probably closer to what you
did in Matlab.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list