In R, I have a character vector like:
vector<-c("BAKING CO", "NEW COBALT", "CO INC")
I would like to convert the word “CO” to “COMPANY”, but only when “CO” appears as a word by itself. I do not want to change the word “cobalt.” My desired output is:
vector<-c("BAKING COMPANY", "NEW COBALT", "COMPANY INC")
Is there a way to do this in R?