Re: [Rd] Is it possible to pass a function argument from R to compiled code in C?

From: Alireza Mahani <>
Date: Tue, 20 Sep 2011 11:07:26 -0700 (PDT)

OK, thanks. But there are two issues with using ".Call":

1- I may give up performance if I am literally running R code inside C, right? In some ways, wouldn't it defy the purpose of calling a compiled code if I end up back in R?

2- If I use the ".Call" interface, the resulting code will be tailored to R, i.e. I will end up having the lengthy code with all the R macros in it. I always prefer to use ".C" interface because I can use the exact same piece of code inside of a C program, i.e. I can call the same function either from R or from C. But with .Call, I am passing R's pointers into the function, which obviously I won't be doing when my call comes from inside of C.

Nevertheless, it's good to know that there is at least a sub-optimal solution out there (sub-optimal from my perspective, of course!).



View this message in context: Sent from the R devel mailing list archive at mailing list Received on Tue 20 Sep 2011 - 18:09:09 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 20 Sep 2011 - 18:40:32 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive