Re: [R] Efficient access to elements of a list of lists

2012-03-11 Thread Benilton Carvalho
Thanks Henrik!!! Hope to pay your beer soon. :) b __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-containe

Re: [R] Efficient access to elements of a list of lists

2012-03-11 Thread Henrik Bengtsson
On Sun, Mar 11, 2012 at 9:18 AM, Benilton Carvalho wrote: > Hi, > > I have a long list of lists from which I want to efficiently extract > and rbind elements. So I'm using the approach below: > > > f <- function(i){ >    out <- replicate(5, list(matrix(rnorm(80), nc=20))) >    names(out) <- letter

[R] Efficient access to elements of a list of lists

2012-03-11 Thread Benilton Carvalho
Hi, I have a long list of lists from which I want to efficiently extract and rbind elements. So I'm using the approach below: f <- function(i){ out <- replicate(5, list(matrix(rnorm(80), nc=20))) names(out) <- letters[1:5] out } set.seed(1) lst <- lapply(1:1.5e6, f) (t0 <- system.tim