Search code examples
revaluationexpression-evaluation

R: How to go from a vector of strings to a vector of quotes / names?


How to get from

input = c("a", "b", "c")

to

output = c(quote(a), quote(b), quote(c))

automatically?


Solution

  • List apply as.symbol() to your input vector.

    lapply(X = input, as.symbol)