I have a string that contains back quotes, which mess up the concatenate function. If you try to concatenate with back ticks, the concatenate function doesn't like this:
a <- c(`table`, `chair`, `desk`)
Error: object 'chair' not found
bad.string <- "`table`, `chair`, `desk`"
a <- gsub("`", "", bad.string)
"table, chair, desk".
good.object <- c("table", "chair", "couch", "lamp", "stool")
good.string <- trimws(unlist(strsplit(gsub("`", "", bad.string), ",")))
gsub() is used to remove the backticks,
strsplit converts a single string into a list of strings, where the comma in the original string denotes the separation,
unlist() converts the list of strings into a vector of strings and
trimws() deletes trailing or leading whitespaces.