str
,
but with duplicate elements removed.
stri_unique(str, ..., opts_collator = NULL)
opts_collator
stri_opts_collator
, NULL
for default collation optionsunique
, this function
tests for canonical equivalence of strings (and not
whether the strings are just bytewise equal). Such an operation
is locale-dependent. Hence, stri_unique
is significantly
slower (but much better suited for natural language processing)
than its base R counterpart.See also stri_duplicated
for indicating non-unique elements.
%s<%< a="">
,
stri_compare
,
stri_count_boundaries
,
stri_duplicated
,
stri_enc_detect2
,
stri_extract_all_boundaries
,
stri_locate_all_boundaries
,
stri_opts_collator
,
stri_order
,
stri_split_boundaries
,
stri_trans_tolower
,
stri_wrap
, stringi-locale
,
stringi-search-boundaries
,
stringi-search-coll
# normalized and non-Unicode-normalized version of the same code point:
stri_unique(c("\u0105", stri_trans_nfkd("\u0105")))
unique(c("\u0105", stri_trans_nfkd("\u0105")))
stri_unique(c("gro\u00df", "GROSS", "Gro\u00df", "Gross"), strength=1)
Run the code above in your browser using DataLab