I created several matrices with the assign function as follows:
for (i in 2:105) { # Loop for creating and filling matrices
(assign(paste("m",i,sep=""),Datos[(x[i-1]+1):x[i],1:14]))
}
This give me several matrices… from m2 to m105… which is exactly what i wanted because i can extract and call this matrices with their index like m2[i,j] or m65[i,j] etc.
My problem is that I want to make a loop which include all my “m” matrices, but I don’t know what could be the right code to do so because I need something like:
paste("m",i,"[i,j]",sep="") to return m2[i,j]…m3[i,j] …… m105[i,j] and do the loop over this , but clearly the paste function returns a string and don’t recognize m2…. m105 like matrices….. it returns m2[i,j] as text.
What should I do ?
Thank you very much !
regards
You have to use
get: