Is it possible to dynamically convert strings into object references? Suppose we have:
a <- 5
b <- 6
letters <- c("a", "b")
eval(parse(text = "a")) returns the value for a, or 5. Is it possible to have the values for multiple strings returned? When I include multiple strings in parse only the last value is returned.
>eval(parse(text = letters))
[1] 6
The desired output is a vector or values for the inputted strings:
[1] 5 6
mget()with vectors of strings, including with dplyr and data.table. Ultimately your intent is to parameterize which objects you pass into function calls, right? It is possible to avoid writing this sort of code.