Capitalizing - every first letter of a word is changed to upper case
Source:R/capwords.R
capwords.RdA simple function to capitalize a character string: the first letter of every word is changed to upper case. Optionally, all other letters are changed to lower case.
Value
A character vector of the same length and with the same attributes
as x (after possible coercion).
Author
From the help page of chartr
Examples
capwords(c("using AIC for model selection"))
#> [1] "Using AIC For Model Selection"
## -> [1] "Using AIC For Model Selection"
capwords(c("using AIC", "for MODEL selection"), strict = TRUE)
#> [1] "Using Aic" "For Model Selection"
## -> [1] "Using Aic" "For Model Selection"
## ^^^ ^^^^^
## 'bad' 'good'