Re: [R] changing the number of elements in a list

2010-06-09 Thread 09wkj
I might give this a try as well: my.list <- replicate(3, matrix(0, ncol=3, nrow=3), simplify=FALSE) args(replicate) function (n, expr, simplify = TRUE) > replicate(3, matrix(0, ncol=3, nrow=3), simplify=FALSE) [[1]] [,1] [,2] [,3] [1,]000 [2,]000 [3,]00

Re: [R] changing the number of elements in a list

2010-06-09 Thread Ivan Calandra
Hi, What about: my.list <- vector(mode="list", length=number_of_matrices) ? HTH, Ivan Le 6/9/2010 15:46, Luis Borda de Agua a écrit : I would like to have a list where each element is a matrix, for example: my.list<- list(matrix(0, ncol=3, nrow=3), matrix(0, ncol=3, nr