[R] R-1.4.0: how to use getSymbolInfo()?
Setzer.Woodrow@epamail.epa.gov
Setzer.Woodrow at epamail.epa.gov
Mon Dec 17 15:34:52 CET 2001
Thanks, Duncan. That is exactly what I was looking for! and yes, it is
getNativeSymbolInfo(); sorry for the confusion.
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
Duncan Temple Lang
<duncan at research.bell To: Woodrow Setzer/RTP/USEPA/US at EPA
-labs.com> cc: r-help at stat.math.ethz.ch
Subject: Re: [R] R-1.4.0: how to use getSymbolInfo()?
12/15/01 11:10 AM
Setzer.Woodrow at epamail.epa.gov wrote:
>
> Welll, getSymbolInfo() returns a list that includes an external
pointer
> object. I guess my question is, how to unwrap it in the c code so
that
> I can use it as (*f)()?
Hi Woodrow,
I have been away from the office for the past few days, so didn't
get your mail until now. Just in case you haven't got an answer, here
is one.
As you correctly point out, what you need is a way to unwrap the
external pointer. The C routine R_ExternalPtrAddr() will do this
for you.
Your situation is one of the contexts that motivated adding the
reflectance information about native symbols. We can pass R functions
or "NativeSymbol" objects and have C code handle them appropriately.
I put together two examples of the mechanism and they are available
at
http://cm.bell-labs.com/stat/duncan/RSymbolInfo.tar.gz
The file basic.c shows what you need to do. chandler.c shows how to
handle either an R function or a NativeSymbol object.
BTW, it is getNativeSymbolInfo() rather than getSymbolInfo(), isn't it?
Duncan.
>
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._._._._
--
_______________________________________________________________
Duncan Temple Lang duncan at research.bell-labs.com
Bell Labs, Lucent Technologies office: (908)582-3217
700 Mountain Avenue, Room 2C-259 fax: (908)582-3340
Murray Hill, NJ 07974-2070
http://cm.bell-labs.com/stat/duncan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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