[Rcpp-devel] Rcpp modules and parsing an object back and forth between R & C++

Hadley Wickham h.wickham at gmail.com
Tue Feb 19 17:21:47 CET 2013


Hi all,

I'd like to have a simple C++ object that I can work with in either
C++ or R.  I can create the class, and expose it to R with modules
(https://gist.github.com/hadley/4987110), but I don't know how to
write the SEXP constructor or SEXP() operator to make it easy to move
it back and worth between C++ and R. I presume I just have to grab and
cast an external pointer, but I don't know the structure of the R
object that the module creates. Could anyone point me in the right
direction?

Thanks!

Hadley

-- 
Chief Scientist, RStudio
http://had.co.nz/


More information about the Rcpp-devel mailing list