[Rcpp-devel] Copying a NumericVector from a list within a list

Dion Detterer dion.detterer at gmail.com
Sun Apr 13 04:01:15 CEST 2014


Hi,

In R I have a list containing another list with a named element "p"
containing a NumericVector. In other words:

> recProb[[1]]$p
[1] 0.2855202 0.6731716 0.8497825 0.7445254 0.2382722

I want to copy this into a NumericVector in Rcpp.

I tried using...

NumericVector nv = clone(recProb[i]["p"]);

...and various other ways with no luck. (i is a variable in a loop.)

What's the best way to do this with the clearest code? Any advice would be
greatly appreciated.

Cheers,
Dion

-- 
Dion C. Detterer
PhD Candidate, Computational Biology
School of Science and Technology
The Centre for Genetic Analysis and Applications
University of New England, Armidale, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20140413/eeeb7ba7/attachment.html>


More information about the Rcpp-devel mailing list