[Rcpp-devel] How to use https://github.com/jjallaire/rcpp-gallery/blob/gh-pages/src/2013-01-05-r-function-from-c++.cpp?

Peng Yu pengyu.ut at gmail.com
Fri May 24 06:14:42 CEST 2013


Hi,

I'm able to compile 2013-01-05-r-function-from-c++.cpp to the .so
file. But I'm not able to call "callFunction" in R does anybody know
what the correct way is to call R functions in C++? Thanks.

> dyn.load('2013-01-05-r-function-from-c++.so')
> x <- rnorm(1e5)
> .Call('callFunction', x, fivenum)
Error in .Call("callFunction", x, fivenum) :
  C symbol name "callFunction" not in load table
> callFunction(x, fivenum)
Error: could not find function "callFunction"

-- 
Regards,
Peng


More information about the Rcpp-devel mailing list