[Rcpp-devel] List of Lists to List of Vectors

Tim Keitt tkeitt at utexas.edu
Tue May 5 22:04:10 CEST 2015


On Mon, May 4, 2015 at 2:37 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

> Keep us posted.


After all that, I ended up with

  lapply(lapply(1:length(x[[1]]),
                function(i) lapply(x, function(a) a[[i]])),
         unlist)

Probably fast enough. Its just too painful to deal with the possible types
in C/C++. (Browsing the R source shows hundreds of lines of C code to
support 'unlist').

THK

-- 
http://www.keittlab.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150505/dda7c259/attachment.html>


More information about the Rcpp-devel mailing list