I HAVE A SERIES OF CHARACTER VALUES THAT LOOK LIKE THIS. I Want Them To Look Like This.
I have a set of words however that, when matched exactly, should remain as they are. In this list would be things like ABC.
For the input
SIX SIXTY TEST SUBJECT
with exclusion "SIX"
The desired output would be "SIX Sixty Test Subject".
My current code is this:
x <- gsub(paste0("(", paste(exclusions, collapse = "|"), "|\\w)(\\w*)"), "\\U\\1\\L\\2", x, perl = T)