Rodney,
With all due respect, try _minimally reproducible_ examples.
There is still so much clutter in the example you posted that it is hard to
see the forest for the trees...
You are once again tripping over as<>() and wrap(). You _must_ use as<int>
as the following working example:
R> library(inline)
R> mcmc <- list(names=list("M", "burnin", "thin", "save"), save=list("beta",
"rho", "mu", "theta"), M=2, burnin=0, thin=1)
R> f <- cxxfunction(signature(list3="ANY"), plugin="Rcpp", body='
+ Rcpp::List L3(list3);
+ int M = Rcpp::as<int>(L3["M"]);
+ return Rcpp::wrap(M);
+ ')
R> f(mcmc)
[1] 2
R>
Not sure why mcmc needs all those layers. This works too:
R> f( list(M=42) )
[1] 42
R>
Hth, Dirk
--
Dirk Eddelbuettel | [email protected] | http://dirk.eddelbuettel.com
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel