I do:
assign('test', 'bye')
test
[1] "bye"
now, I have the vector inside ‘test‘ variable.
I would like to use the string inside ‘test’ variable as name of a column of the follow list:
list(test=c(1:10))
$test
[1] 1 2 3 4 5 6 7 8 9 10
But I would like to use ‘bye’ as NAME (because ‘bye’ is wrote inside the test variable)
How can I do it?
I don’t think
evalorassignare at all necessary here; their use usually (although not always) indicates that you’re doing something the hard way, or at least the un-R-ish way.If you really want to do this in a single statement, you can do:
or