I would like to add quotation marks to hundreds of words (surrounded by blank spaces) and separate them by a comma. Preferably, by using only one or a few functions to avoid a manual replacement due to temporal expenditure.
Exemplary Problem:
words <- c("Paris Milan Berlin")
Output should be: "Paris","Milan","Berlin"
I've already tried gsub()
and str_extract()
, however I did not get the desirable outcome.