Skip to content
Prev 208041 / 398502 Next

Create matrix with subset from unlist

On Jan 29, 2010, at 1:07 PM, Muhammad Rahiz wrote:

            
It will "work".
If you go back to your original posting, you could shortcut the whole  
process since you already had a list of 32 dataframes (lists) . That  
was the starting point. If a list is acceptable, then skip the  
intermediate array.

 > class(x[[1]])
[1] "data.frame"
 > class(lapply(x, data.matrix)[[1]])
[1] "matrix"

So just do this:

xx2 <- lapply(x, data.matrix)  # a list of matrices