There are a slew of answers out there on how to remove extra whitespace from between words, which is super simple. However, I\'m finding that removing extra whitespace
You may try this,
> x <- c("L L C", "P O BOX 123456", "NEW YORK") > gsub("(?<=\\b\\w)\\s(?=\\w\\b)", "", x,perl=T) [1] "LLC" "PO BOX 123456" "NEW YORK"
It just removes the space which exists between two single word characters.