to_any_case()
Internal helper to test the design rules for any string and setting of to_any_case()
check_design_rule(string, sep_in = NULL, transliterations = NULL,
sep_out = NULL, prefix = "", postfix = "", unique_sep = NULL,
empty_fill = NULL, parsing_option = 1)
A character vector separated by underscores, containing the parsed string.
A string (for example names of a data frame).
String that will be wrapped internally into stringr::regex()
.
All matches will be treated as additional splitting parameters besides the default ones
("_"
and " "
), when parsing the input string.
A character vector (if not NULL
). The entries of this argument
need to be elements of stringi::stri_trans_list()
(like "Latin-ASCII", which is often useful) or names of lookup tables (currently
only "german" is supported). In the order of the entries the letters of the input
string will be transliterated via stringi::stri_trans_general()
or replaced via the
matches of the lookup table.
String that will be used as separator. The defaults are "_"
and ""
, regarding the specified case
.
prefix (string).
postfix (string).
A string. If it is supplied, then duplicated names will get a suffix integer in the order of their appearance. The suffix is separated by the supplied string to this argument.
A string. If it is supplied, then each entry that matches "" will be replaced by the supplied string to this argument.
An integer that will determine the parsing_option.
1: RRRStudio -> RRR_Studio
2: RRRStudio -> RRRS_tudio
3: parses at the beginning like option 1 and the rest like option 2.
4: parses at the beginning like option 2 and the rest like option 1.
5: parses like option 1 but suppresses "_" around non special characters. In this way case conversion won't apply after these characters. See examples.
6: parses like option 1, but digits directly behind/in front non-digits, will stay as is.
any other integer <= 0: no parsing"
Malte Grosser, malte.grosser@gmail.com