stri_compare
, stri_order
,
stri_unique
, stri_duplicated
,
as well as stri_detect_coll
and other stringi-search-coll functions.stri_opts_collator(locale = NULL, strength = 3L,
alternate_shifted = FALSE, french = FALSE, uppercase_first = NA,
case_level = FALSE, normalization = FALSE, numeric = FALSE, ...)
NULL
or
""
for default locale1
for the most permissive collation rules, 4
for the most
strict onesFALSE
treats all the code points with non-ignorable primary weights in the same way,
TRUE
causes code points with primary weights that are equal or below
the variable top value to be ignored on primary level and moved to the quaternary levelTRUE
results in secondary weights being considered backwardsNA
orders upper and lower case letters in accordance to their tertiary weights,
TRUE
forces upper case letters to sort before lower case letters,
FALSE
does the oppositeTRUE
,
then incremental check is performed to see whether the input data is in
the FCD form. If the data is not in the FCD form, incremental NFD
normalization is performedstrength
:
generally, strength
set to 4 is
the least permissive.
Set to 2 to ignore case differences.
Set to 1 to also ignore diacritical differences. The strings are Unicode-normalized before the comparison.icu::Collator
Class Reference -- ICU4C API Documentation,
http://www.icu-project.org/apiref/icu4c/classicu_1_1Collator.html%s<%
,
stri_compare
,
stri_count_boundaries
,
stri_duplicated
,
stri_enc_detect2
,
stri_extract_all_boundaries
,
stri_locate_all_boundaries
,
stri_order
,
stri_split_boundaries
,
stri_trans_tolower
,
stri_unique
, stri_wrap
,
stringi-locale
,
stringi-search-boundaries
,
stringi-search-coll
Other search_coll: stringi-search-coll
,
stringi-search
stri_cmp("number100", "number2")
stri_cmp("number100", "number2", opts_collator=stri_opts_collator(numeric=TRUE))
stri_cmp("number100", "number2", numeric=TRUE) # equivalent
stri_cmp("above mentioned", "above-mentioned")
stri_cmp("above mentioned", "above-mentioned", alternate_shifted=TRUE)
Run the code above in your browser using DataLab