I am looking for a way to convert specific words from a list outside of R to a character vector of strings. I need this as I am doing some regex work and the words will be used as filter terms in a data frame.
For instance, let's say I have a series of unquoted words (e.g. If I were to type in the source screen of r-studio):
audi
chevrolet
honda
ford
I want the above to be turned into:
strings = c("audi","chevrolet","honda","ford")
As then, I can use it in the following filter:
mpg %>% filter(manufacturer %in% strings)
The above use is just an example. I'm really looking for a way to turn unquoted text, that has been either entered manually into R or copy-pasted into R, into a comma-separated character vector that can be used for various things. Also, what is the unquoted text that is not a comment in R?