Skip to content
Prev 167630 / 398502 Next

creating a list of matrices or data frames

On 1/20/2009 11:34 AM, Simon Pickett wrote:
df.list <- vector("list", 3) # create list

for(i in 1:3){df.list[[i]] <- matrix(data = NA,
                                     nrow = i,
                                     ncol = 3,
                                     byrow = FALSE,
                                     dimnames = NULL)}

do.call(rbind, df.list) # rbind list elements