Given a vector of strings, I would like to create an expression without the quotation marks.
# eg, I would like to go from
c(\"string1\", \"string2\")
# to...
I tend to use as.quoted
from the plyr package
outputString <- sprintf('list(%s)', paste(input, collapse = ', '))
library(plyr)
output <- as.quoted(outputString)[[1]]
mydt[, eval(output)]
string1 string2
1: A a
2: B b
3: C c
However if it is simply column selection, you can pass the string and use ..
(which, like in the Unix terminal, means to "look up one level")
mydt[ , ..input]
string1 string2
1: A a
2: B b
3: C c