This is a StackOverflow answer I'm trying to implement, but that global $1 doesn't seem to work.
library(stringr)
str_vec <- c("TodayILiveInTheUSAWithSimon", "USAToday", "IAmSOOOBored")
stringr::str_replace_all(str_vev, "((?<=[a-z])[A-Z]|[A-Z](?=[a-z]))", " $1")
I can't make stringr yield:
Today I Live In The USA With Simon
USA Today
I Am SOOO Bored