[R] R as a daemon?

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jan 3 18:41:29 CET 2001


On 3 Jan 2001, MJ Ray wrote:

> Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:
> 
> > expressions.  As of 1.2.0 you can embed Unix R (you have been able to do
> > so for ages on Windows) and that might be a neater solution.
> 
> How do you mean "embed"?  Sorry for naivity on this, but I've only
> done that within Gnome so far.  Just a link would be fine.

See http://developer.r-project.org/embedded.html

NEWS says

    o   Preliminary support for building R as a shared library (`libR')
        under Unix.  Use configure with option `--enable-R-shlib' or do
        `make libR' in directory `src/main' to create the shared
        library.
        
        There is also a linker front-end `R CMD LINK' which is useful
        for creating executable programs linked against the R shared
        library.

and that's about all there is.

The idea is that you can make a shared library version of R. libR.so, and
link your application against it.  There are even some examples, but I
don't know of a link to those.

> > For an cgi version I would be worried about statefulness.
> > How are you going to stop one command doing something (overwriting
> > system functions, for example) that does not affect later ones
> > submitted by other people?   This applies to DCOM servers etc too,
> > but there one usually has more idea of what might happen.
> 
> As kmself pointed out, the sensible way to do this is by giving each
> client their own R.  This makes sense from two performance ways: the
> same client is likely to send multiple requests in succession; if they
> break their session by doing something "silly", it's their own fault
> and affects only them.

How can cgi identify the client?  You may have fail-safe ways of doing so,
but there is nothing to stop me having two applets in one browser each
talking to the cgi-server, so they will not be straightforward ones.
Perhaps I am thinking much more generally than you intend to implement.

> > There are more possibilities using Omegahat componentry: look on
> > www.omegahat.org.
> 
> I'm confused.  Although the front page says you can call Perl from R
> _and vice-versa_, only calling Perl from R seems to be documented at
> first glance.  The python one looks more useful in that way.

I thought about CORBA, or Perl. (I believe you can go both ways, but if
you tell Duncan what is missing information he is happy to provide it, in
my experience.)  But I would try embedding R first, and you may need to
ask Duncan Temple Lang for his test examples.


-- 
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