[Rd] Embedding R and registering routines

Jeffrey Horner jeff.horner at vanderbilt.edu
Tue May 1 17:20:41 CEST 2007


The use of .Call and the like all depend on loading shared libraries and 
registering routines from it. Also, .Primitive and .Internal depend on 
routines being registered in the R binary. And applications that embed R 
can override routines declared in Rinterfac.h, but is there a way for an 
application embedding R to register other routines defined in the 
application without loading a shared library or re-compiling R?

The only such way I've found that comes close to a solution to this is 
creating an RObjectTable and attaching that to the search path. 
Assignments to variables in that environment can call the table's get 
routine which is defined in the application, and I think that might be 
an interesting solution for a new RApache implementation.

For the RApache Project, the mod_R.c shared library get's loaded into 
the apache process and its purpose is to initializes R. Next, it calls 
'library(RApache)' to load RApache.so, a package that implements the 
RApache API. This two-library system works, but the implementation is 
too complex. I'd like to simplify down to just one shared library.

Any comments, suggestion are much appreciated.



More information about the R-devel mailing list