I'd like to use the output of the glue function as an R object, but it only works as character.
Example: if I try this -
as.factor((
str_glue("iris$`{colnames(iris[5])}`")
))
The result is this:
[1] iris$`Species`
Levels: iris$`Species`
But I want this:
as.factor(iris$`Species`)
[1] setosa setosa setosa setosa setosa setosa setosa setosa setosa
...
[145] virginica virginica virginica virginica virginica virginica
Levels: setosa versicolor virginica
Use
eval
andparse
orparse_expr
: