[R] code efficiency, extr. info from list

Tord Snäll tord.snall at ebc.uu.se
Tue Oct 21 18:59:56 CEST 2003


Dear Anders and Paulo,

Thanks very much for your recommendations! 

I did it this way:

test2 <- unlist(lapply(test, function(x)
                cbind(x$par[1], x$par[2], x$value, x$conv)))
m<- as.data.frame(matrix(test2, nrow = dim(grid)[1], ncol = 4, byrow = T))
names(m) <- c("s2", "rho", "value", "conv")

but I sure there are better ways....


Sincerely,
Tord




More information about the R-help mailing list