capitalize() returns a character vector x with the first
alphabetic character replaced with a capital form (if one exists).
capitalize(x)
plu_capitalize(x)
is_capital(x, strict = FALSE)
is_capitalized(x, strict = FALSE)A character vector.
If strict is TRUE, is_capital() and is_capitalized()
return FALSE instead of NA when characters are neither capital nor
lowercase.
Defualts to FALSE.
capitalize() returns a character vector of the same length as x.
is_capital() and is_capitalized() return a logical vector of the same
length as x.
is_capital() returns TRUE if all characters are capital, FALSE if
all characters are lowercase, and NA if characters are mixed case or any
characters are caseless (e.g. numbers, punctuation marks, characters from a
unicase language like Arabic, Chinese or Hindi).
is_capitalized() returns TRUE if the first alphabetic character in a
string is capital, FALSE if the first alphabetic character is lowercase,
and NA if there are no alphabetic characters.
capitalize(c("word", "a whole phrase"))
#> [1] "Word" "A whole phrase"
capitalize("preserving MIXED Case")
#> [1] "Preserving MIXED Case"
capitalize("... word")
#> [1] "... Word"
is_capital(c("a", "A", "!"))
#> [1] FALSE TRUE NA
is_capital(c("aa", "AA", "!!"))
#> [1] FALSE TRUE NA
is_capital("Aa")
#> [1] NA
is_capitalized(c("a word", "A word", "a Word"))
#> [1] FALSE TRUE FALSE
is_capitalized("... A word")
#> [1] TRUE
is_capitalized("...")
#> [1] NA