[R] R-1.4.0: how to use getSymbolInfo()?

Setzer.Woodrow@epamail.epa.gov Setzer.Woodrow at epamail.epa.gov
Thu Dec 13 14:49:42 CET 2001


I have a package that solves systems of ordinary differential equations
coded as an R function (odesolve, on CRAN).  The function is passed to R
code, and c and Fortran code called by it uses lang4() and eval() to
evaluate the R function inside a compiled c function to use in a
compiled ODE solver.  This works quite well, but can be slow.

I'd like to be able to supply the name of a compiled function,
dynamically loaded into the current session, and pass either the name of
the function or a pointer to it to my R code, which would then pass it
down to the compiled code to use in the ode solver directly.

Since getSymbolInfo() (new in 1.4.0) returns a pointer to the requested
loaded function, it would seem to be part of the answer to my problem
(when I asked this question some time ago, I was warned away from using
the internal R_FindSymbol() (declared in Rdynload.h) as being
potentially unstable).  However, I cannot figure out how to pass the
pointer through .Call or .External.  Is this possible, or should I pass
a string through to the compiled code, and find the pointer on that side
(and how to do that)?

Thanks.


R. Woodrow Setzer, Jr.                                            Phone:
(919) 541-0128
Experimental Toxicology Division                       Fax:  (919)
541-5394
Pharmacokinetics Branch
NHEERL MD-74; US EPA; RTP, NC 27711

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