search for: bestanswer

Displaying 1 result from an estimated 1 matches for "bestanswer".

2010 Sep 04
4
Please explain "do.call" in this context, or critique to "stack this list faster"
...( dataComplete <- as.data.frame(matrix(0, nrow = nr*m, ncol = nc)) ) system.time( for (j in 1:m) dataComplete[(((j-1)*nr) + 1):(j*nr), ] <- mylist[[j]] ) ## On my Thinkpad T62 dual core, the "shortAnswer" approach takes about ## three times as long: ## > system.time( bestAnswer <- do.call("rbind",mylist) ) ## user system elapsed ## 14.270 1.170 15.433 ## > system.time( ## + dataComplete <- as.data.frame(matrix(0, nrow = nr*m, ncol = nc)) ## + ) ## user system elapsed ## 0.000 0.000 0.006 ## > system.time( ## + for (j in 1:m)...