[Rcpp-devel] Newbie question: RInside from within a Inline/Rcpp cxxfunction

Dan.Pagendam at csiro.au Dan.Pagendam at csiro.au
Fri Sep 28 05:48:19 CEST 2012


Hi,

this is my first post here.  I've just started to explore the uses of Rcpp, Inline and RInside and must say that I think these are really fantastic tools, which I hope to use routinely in the future.

I'm about to embark on writing some code, but before I do, I was hoping somebody can offer a quick "sanity check" for me and let me know if what I am proposing is achievable and sensible.

Bascially, I would like to write a cxxfunction in R using Rcpp and Inline so that I can execute my C++ code easily from within R.  However, I'd like my C++ code comprising the cxxfunction to make use of the R language too.  Is it possible for me to have my cxxfunction instantiate an object of class RInline within the C++ code?  I guess what I'm getting at is, can I get R to call on a C++ function which in turn calls upon R code?

I've looked at plenty of examples of code that use RInline and it seems that they are all just based around calling on R from with C++.  This is making me wonder if what I am suggesting above is either plain dumb or just not possible.

Thanks in advance for your help,

Dan

Dr Dan Pagendam
OCE Postdoctoral Research Fellow
CSIRO Mathematics, Informatics and Statistics

Phone: +61 7 3833 5535 | Mobile: +61 4 3295 8551
Email: Dan.Pagendam at csiro.au<mailto:Dan.Pagendam at csiro.au><mailto:Dan.Pagendam at csiro.au<mailto:Dan.Pagendam at csiro.au>> | http://www.csiro.au
Postal Address: CSIRO Mathematics Informatics and Statistics, EcoSciences Precinct, PO Box 2583, Brisbane, QLD 4001
Street Address: CSIRO Mathematics Informatics and Statistics, EcoSciences Precinct, 41 Boggo Road, Dutton Park, QLD 4102





More information about the Rcpp-devel mailing list