[R] How can I call R from Java or C?

Aylin Yilmaz aylin at ncmir.ucsd.edu
Thu Dec 11 21:57:58 CET 2003


Hi,

Thanks for the reply.
I develop on Linux and the production will be on Unix.

I just looked at SJava on OmegaHat.
Yes, I think this is what I need. Can I call any R function using this
interface such as the tests in ctest package?


Thanks a lot.

On Thu, 11 Dec 2003, Prof Brian Ripley wrote:

> On Wed, 10 Dec 2003, Aylin Yilmaz wrote:
>
> > I am new to R. I have been looking for a way to call R functions from
> > Java or C.
> >
> > What I have found so far is: I can execute R commands in batch mode from a
> > file and redirect the output to another file. However, I am not sure this
> > is the way to do it.
> >
> > About C, is it true that I can only call R from a C process,only if that C
> > process is invoked within R itself? So is it R->C->R ?
>
> Not true.  There are several ways to embed R in a C-based executable, but
> as you have not told us your OS, I won't elaborate.
>
> > If I could call R from C, then I could possibly call C from Java using
> > JNI (i am not sure exactly how well that will work)
>
> Have you looked at the SJava package on the Omegahat site?
>
> --
> 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 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>
>




More information about the R-help mailing list