On 7 August 2012 at 14:43, Stephen J. Barr wrote:
| Thanks for the pointer to sugar. 
| 
| I was just trying to think of a simple example. So my C++ code will be
| essentially:
| 
| int main() {
| 
|     RInside R(argc, argv);          // create an embedded R instance 
|     R.parseEval("X = generateSomeMatrix()");

You need something like we use in the example rinside_sample1.cpp I already
pointed you too:

    Rcpp::NumericVector v = R.parseEval(str);   // eval string, Z then assigned 
to num. vec              

as you need __assign__ the result of the parseEval() to something.

This could be as generic as

    SEXP mytmp = R.parseEval("X = generateSomeMatrix()");

and you can then use mytmp instantiate an RcppEigen object as you would have
if the object had been passed down from R.

Hth, Dirk

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com  
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to