Possible Duplicate:
generate variable names (something like get())
If I want to create matrices with different names in an automatized way, I run into problems.
For example, I want to create three matrices named a1,a2 and a3.
x<-1:3
a<-"a"
listofnames<-paste(a,x) ## a vector with the names that I want to use for my matrices
My problem is to assign a matrix the different names from the vector I created. For example, to create a matrix called a1 (the first "name" in my vector), this will of course not work at all:
listofnames[1]<-matrix(ncol=2,nrow=2)
But how would I do it?
I've been looking on the internet but can't find any answer.. Thank you so much for your help