Wrappers around to_any_case()
to_snake_case(string, abbreviations = NULL, sep_in = "[^[:alnum:]]", parsing_option = 1, transliterations = NULL, numerals = "middle", sep_out = NULL, unique_sep = NULL, empty_fill = NULL, prefix = "", postfix = "") to_lower_camel_case(string, abbreviations = NULL, sep_in = "[^[:alnum:]]", parsing_option = 1, transliterations = NULL, numerals = "middle", sep_out = NULL, unique_sep = NULL, empty_fill = NULL, prefix = "", postfix = "") to_upper_camel_case(string, abbreviations = NULL, sep_in = "[^[:alnum:]]", parsing_option = 1, transliterations = NULL, numerals = "middle", sep_out = NULL, unique_sep = NULL, empty_fill = NULL, prefix = "", postfix = "") to_screaming_snake_case(string, abbreviations = NULL, sep_in = "[^[:alnum:]]", parsing_option = 1, transliterations = NULL, numerals = "middle", sep_out = NULL, unique_sep = NULL, empty_fill = NULL, prefix = "", postfix = "") to_parsed_case(string, abbreviations = NULL, sep_in = "[^[:alnum:]]", parsing_option = 1, transliterations = NULL, numerals = "middle", sep_out = NULL, unique_sep = NULL, empty_fill = NULL, prefix = "", postfix = "") to_mixed_case(string, abbreviations = NULL, sep_in = "[^[:alnum:]]", parsing_option = 1, transliterations = NULL, numerals = "middle", sep_out = NULL, unique_sep = NULL, empty_fill = NULL, prefix = "", postfix = "") to_lower_upper_case(string, abbreviations = NULL, sep_in = "[^[:alnum:]]", parsing_option = 1, transliterations = NULL, numerals = "middle", sep_out = NULL, unique_sep = NULL, empty_fill = NULL, prefix = "", postfix = "") to_upper_lower_case(string, abbreviations = NULL, sep_in = "[^[:alnum:]]", parsing_option = 1, transliterations = NULL, numerals = "middle", sep_out = NULL, unique_sep = NULL, empty_fill = NULL, prefix = "", postfix = "") to_swap_case(string, abbreviations = NULL, sep_in = "[^[:alnum:]]", parsing_option = 1, transliterations = NULL, numerals = "middle", sep_out = NULL, unique_sep = NULL, empty_fill = NULL, prefix = "", postfix = "") to_sentence_case(string, abbreviations = NULL, sep_in = "[^[:alnum:]]", parsing_option = 1, transliterations = NULL, numerals = "middle", sep_out = NULL, unique_sep = NULL, empty_fill = NULL, prefix = "", postfix = "") to_random_case(string, abbreviations = NULL, sep_in = "[^[:alnum:]]", parsing_option = 1, transliterations = NULL, numerals = "middle", sep_out = NULL, unique_sep = NULL, empty_fill = NULL, prefix = "", postfix = "") to_title_case(string, abbreviations = NULL, sep_in = "[^[:alnum:]]", parsing_option = 1, transliterations = NULL, numerals = "middle", sep_out = NULL, unique_sep = NULL, empty_fill = NULL, prefix = "", postfix = "")
string | A string (for example names of a data frame). |
---|---|
abbreviations | character. (Case insensitive) matched abbreviations are surrounded by underscores. In this way, they can get recognized by the parser. This is useful when e.g. Use this feature with care: One letter abbreviations and abbreviations next to each other are hard to read and also not easy to parse for further processing. |
sep_in | (short for separator input) if character, is interpreted as a
regular expression (wrapped internally into |
parsing_option | An integer that will determine the parsing_option.
|
transliterations | A character vector (if not |
numerals | A character specifying the alignment of numerals ( |
sep_out | (short for separator output) String that will be used as separator. The defaults are |
unique_sep | A string. If not |
empty_fill | A string. If it is supplied, then each entry that matches "" will be replaced by the supplied string to this argument. |
prefix | prefix (string). |
postfix | postfix (string). |
A character vector according the specified parameters above.
A character vector according the specified target case.
caseconverters are vectorised over string
, sep_in
, sep_out
,
empty_fill
, prefix
and postfix
.
snakecase on github, to_any_case
for flexible high level conversion and more examples.
#> [1] "this_is_a_strange_string" "and_this_another_one" #> [3] NAto_lower_camel_case(strings)#> [1] "thisIsAStrangeString" "andThisAnotherOne" NAto_upper_camel_case(strings)#> [1] "ThisIsAStrangeString" "AndThisAnotherOne" NAto_screaming_snake_case(strings)#> [1] "THIS_IS_A_STRANGE_STRING" "AND_THIS_ANOTHER_ONE" #> [3] NAto_lower_upper_case(strings)#> [1] "thisISaSTRANGEstring" "andTHISanotherONE" NAto_upper_lower_case(strings)#> [1] "THISisAstrangeSTRING" "ANDthisANOTHERone" NAto_parsed_case(strings)#> [1] "this_Is_a_Strange_string" "AND_THIS_ANOTHER_One" #> [3] NAto_mixed_case(strings)#> [1] "this_Is_a_Strange_string" "And_This_Another_One" #> [3] NAto_swap_case(strings)#> [1] "THIS iS A sTRANGE_STRING" "and this another_oNE" #> [3] NAto_sentence_case(strings)#> [1] "This is a strange string" "And this another one" #> [3] NAto_random_case(strings)#> [1] "THiS iS A sTRANgE_stRInG" "ANd thIS anOThER_OnE" #> [3] "NA"to_title_case(strings)#> [1] "This is a Strange String" "And this Another One" #> [3] NA