Let' s say that :
colstr="mycol"
Now, for a given df that contains a column named mycol, I want to do the following :
myfactors <- factor(df$colstr)
This does not work as the command is executed as:
myfactors <- factor(df$"mycol")
istead of the correct :
myfactors <- factor(df$mycol)
How can I correct this?