Hi I'm trying to name variables using a for loop so I get dynamic names for my variables.
for (i in 1:nX) { paste("X",i, sep="")=datos[,i+1] next }
use assign as in:
assign
x <- 1:10 for(i in seq_along(x)){ assign(paste('X', i, sep=''), x[i]) }
1.4m articles
1.4m replys
5 comments
57.0k users