I wonder if there is a simple way to produce a list of variables using a for loop, and give its value.
for(i in 1:3) { noquote(paste("a",i,sep=""))=i }
for(i in 1:3)
{
noquote(paste("a",i,sep=""))=i
}
In the above code, I try to create a1a1
, a2a2
, a3a3
, which assign to the values of 1, 2, 3. However, R gives an error message. Thanks for your help.
Han