I'm trying to loop through a list of numbers and concatenate them at the end of a variable.
for(i in c(3,6,9)) {
x3=...
x6=...
x9=... }
Is there a way to macro numbers using R such as something like x`i'?
I'm trying to loop through a list of numbers and concatenate them at the end of a variable.
for(i in c(3,6,9)) {
x3=...
x6=...
x9=... }
Is there a way to macro numbers using R such as something like x`i'?
It is possible but not recommended:
for(i in c(3,6,9))
assign(paste("a",i,sep=""),value=...)