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

Alireza Mahani alireza.s.mahani at gmail.com
Tue Sep 20 20:07:26 CEST 2011


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

-Alireza

--
View this message in context: http://r.789695.n4.nabble.com/Is-it-possible-to-pass-a-function-argument-from-R-to-compiled-code-in-C-tp3827563p3827690.html
Sent from the R devel mailing list archive at Nabble.com.



More information about the R-devel mailing list