Skip to content
Prev 1182 / 10988 Next

[Rcpp-devel] Rcpp-devel Digest, Vol 12, Issue 8

On Fri, Oct 8, 2010 at 5:33 AM, Dirk Eddelbuettel <edd at debian.org> wrote:
Ah. I see now that, in the example above, mylist["a"] is a 1-length
NumericVector and (mylist["b"])[1] is a double.  My confustion was
using (mylist["b"])[1] in places that expected a NumericVector (like
Rf_PrintValue() or return() ), or trying to pull the single element
into a NumericVector:

NumericVector i(mylist["b]);

which, of course, initializes a NumericVector of length mylist["b"].

Thanks,
Christian