Hi,

I'm new to programming, new to R and even new to mailing lists so please be patient with me. I need to manage many matrices generated by an R program. These matrices have different dimensions and I'd like to group them somehow. The best way would be to have a big matrix (let's call it database) where every element database[x,y] consists of a list of matrices that all have the dimensions ncol(matrix1)=x and nrow(matrix1)=y. So those matrices have to be embedded into lists and the lists have to be embedded in the big database matrix. If I simply try

   database=matrix(0,10,10)
   database[4,4]=c(matrix1,matrix2)

I get

   Error in database[4, 4] = c(matrix1, matrix2) :
     number of items to replace is not a multiple of replacement length
   Execution halted

which makes sense of course... Is there any possibility to make this work? Or maybe there is a better way to organize those matrices?

Regards,
Michael

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to