I would like to convert a string that I pass in a function into an object (or column name).
I know that this works:
df <- data.frame(A = 1:10, B =
In addition to eval(parse(text=YOUR_STRING)), you can use as.symbol as a potential alternative.
eval(parse(text=YOUR_STRING))
as.symbol