[R] How to define a number of matrices through loops

Amarjit Singh Sethi set_alt at yahoo.co.in
Sat Apr 9 05:22:58 CEST 2011


Hi all
I need to deal with a number (say, 5) of diferent ordered matrices  
simultaneously in my computational work. I tried to define these matrices 
through looping, but got an error message:

row <- c(3,4,6,4,5)
mt <- c()
for (i in 1:5){  
mt[i] <- matrix(nrow=row[i],ncol=4)
}
mt

Kindly help

Yours
ajss



More information about the R-help mailing list