[Rd] Embed R, and provide a function to user scripts

Joshua Ulrich josh.m.ulrich at gmail.com
Fri Aug 14 04:33:09 CEST 2009


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
>



More information about the R-devel mailing list