Try this:
mat_list <- lapply(split(mat, seq(nrow(mat))), matrix, ncol = 3)
On Mon, Dec 28, 2009 at 9:20 AM, Ron_M wrote:
>
> let consider following matrix :
>
> mat <- matrix(rnorm(45), 15)
>
> Now I want to convert it to a list object "mat_list", which will have 15
> elements and each element
let consider following matrix :
mat <- matrix(rnorm(45), 15)
Now I want to convert it to a list object "mat_list", which will have 15
elements and each element will again be a matrix with 3 rows and 3 columns.
How can I do that?
Thanks,
--
View this message in context:
http://n4.nabble.com/
2 matches
Mail list logo