Skip to content
Prev 8655 / 10988 Next

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

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

            
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