This takes a string vector and converts it to a specified case

my_case(x, description_case)

Arguments

x

the string vector to be converted

description_case

the desired case (one of title, lower, upper, asis)

Value

a vector with the specified capitalisation style

Examples

library(irtools) my_string <- "This IS A STRING with INCONSISTENT caPItals" # For all Lowers my_case(my_string, "lower")
#> [1] "this is a string with inconsistent capitals"
# For title case my_case(my_string, "title")
#> [1] "This Is A String With Inconsistent Capitals"
# Or print as is my_case(my_string, "asis")
#> [1] "This IS A STRING with INCONSISTENT caPItals"