[R] list element to matrix

dverzi at mail.sdsu.edu dverzi at mail.sdsu.edu
Wed Sep 5 19:47:39 CEST 2007


I have created a list of "matrices" using sapply or lapply and wish to extract each of the "matrices" as a matrix.  Some of them are 2x2, 3x3, etc.

I can do this one at a time as:

M1<-as.matrix(D[[1]])

How can repeat this process for an unknown number of entries in the list?  In other words, how shall I index M1?

Diana



More information about the R-help mailing list