Is it possible to create new variable names on the fly?
I\'d like to read data frames from a list into new variables with numbers at the end. Something like orca1, o
It seems to me that you might be better off with a list rather than using orca1
, orca2
, etc, ... then it would be orca[1]
, orca[2]
, ...
Usually you're making a list of variables differentiated by nothing but a number because that number would be a convenient way to access them later.
orca <- list()
orca[1] <- "Hi"
orca[2] <- 59
Otherwise, assign
is just what you want.