An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20090813/d6c93f4c/attachment.pl>
Embed R, and provide a function to user scripts
4 messages · Saptarshi Guha, Joshua Ulrich
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20090813/123c1315/attachment.pl>
Sorry about the clutter. The answer can be found on Writing R Extensions " 8.1.3 Registering symbols" Thank you Saptarshi Guha On Thu, Aug 13, 2009 at 10:01 PM, Saptarshi Guha
<saptarshi.guha at gmail.com> wrote:
Essentially I'd like to load the C function into? the load table
After that, I can create an R function
rboo=function(x) .Call("boo",x)
then user script cann call rboo
Hope that clarifies things.
Thanks in advance
Saptarshi Guha
On Thu, Aug 13, 2009 at 9:07 PM, Saptarshi Guha <saptarshi.guha at gmail.com> wrote:
Hello,
I'm not sure how to go about this. Suppose I have a function
SEXP boo(SEXP x){
//do something
}
Also, I have an executable which embeds R in itself. I would like to provide a R function to user code to call that calls 'boo' e.g
##user supplied expression that is given to me
x<-1
boo(x)
One way is to create a library with function boo that performs .Call to boo, but is there a way that I can do something like
ainstall("rboo", boo)
and calls to rboo in the language will be sent to 'boo' ?
Thank you
Saptarshi
Saptarshi Guha
Hi Saptarshi, See ?SHLIB and ?dyn.load. HTH, Josh -- http://www.fosstrading.com
On Thu, Aug 13, 2009 at 9:01 PM, Saptarshi Guha<saptarshi.guha at gmail.com> wrote:
Essentially I'd like to load the C function into ?the load table
After that, I can create an R function
rboo=function(x) .Call("boo",x)
then user script cann call rboo
Hope that clarifies things.
Thanks in advance
Saptarshi Guha
On Thu, Aug 13, 2009 at 9:07 PM, Saptarshi Guha <saptarshi.guha at gmail.com>wrote:
Hello,
I'm not sure how to go about this. Suppose I have a function
SEXP boo(SEXP x){
//do something
}
Also, I have an executable which embeds R in itself. I would like to
provide a R function to user code to call that calls 'boo' e.g
##user supplied expression that is given to me
x<-1
boo(x)
One way is to create a library with function boo that performs .Call to
boo, but is there a way that I can do something like
ainstall("rboo", boo)
and calls to rboo in the language will be sent to 'boo' ?
Thank you
Saptarshi
Saptarshi Guha
? ? ? ?[[alternative HTML version deleted]]
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel