stringi (version 0.2-5)

stri_duplicated: Determine Duplicated Elements

Description

stri_duplicated() determines which strings in a character vector are duplicates of other elements.

stri_duplicated_any() determines if there are any duplicated strings in a character vector.

Usage

stri_duplicated(str, fromLast = FALSE, opts_collator = NULL)

stri_duplicated_any(str, fromLast = FALSE, opts_collator = NULL)

Arguments

str
character vector
fromLast
single logical value; indicating whether duplication should be considered from the reverse side
opts_collator
a named list with ICU Collator's options as generated with stri_opts_collator, NULL for default collation options

Value

  • stri_duplicated() returns a logical vector of the same length as str. Each of its elements indicates if an equivalent string already appeared in str.

    stri_duplicated_any() returns a single non-negative integer. Value of 0 indicates that all the elements in str are unique. Otherwise, it gives the index of the first non-unique element.

Details

Missing values are regarded as equal.

These functions test for canonical equivalence of strings. Such an operation is locale-dependent.

See Also

Other locale_sensitive: %!==%, %!=%, %<=%< a="">, %<%< a="">, %===%, %==%, %>=%, %>%, %stri!==%, %stri!=%, %stri<=%< a="">, %stri<%< a="">, %stri===%, %stri==%, %stri>=%, %stri>%; stri_cmp, stri_cmp_eq, stri_cmp_equiv, stri_cmp_ge, stri_cmp_gt, stri_cmp_le, stri_cmp_lt, stri_cmp_neq, stri_cmp_nequiv, stri_compare; stri_count_coll; stri_detect_coll; stri_enc_detect2; stri_extract_all_coll, stri_extract_first_coll, stri_extract_first_coll, stri_extract_last_coll, stri_extract_last_coll; stri_extract_words; stri_locate_all_coll, stri_locate_first_coll, stri_locate_first_coll, stri_locate_last_coll, stri_locate_last_coll; stri_locate_boundaries; stri_locate_words; stri_opts_collator; stri_order, stri_sort; stri_replace_all_coll, stri_replace_first_coll, stri_replace_first_coll, stri_replace_last_coll, stri_replace_last_coll; stri_split_boundaries; stri_split_coll; stri_trans_tolower, stri_trans_totitle, stri_trans_toupper; stri_unique; stri_wrap; stringi-locale; stringi-search-coll

Other locale_sensitive: %!==%, %!=%, %<=%< a="">, %<%< a="">, %===%, %==%, %>=%, %>%, %stri!==%, %stri!=%, %stri<=%< a="">, %stri<%< a="">, %stri===%, %stri==%, %stri>=%, %stri>%; stri_cmp, stri_cmp_eq, stri_cmp_equiv, stri_cmp_ge, stri_cmp_gt, stri_cmp_le, stri_cmp_lt, stri_cmp_neq, stri_cmp_nequiv, stri_compare; stri_count_coll; stri_detect_coll; stri_enc_detect2; stri_extract_all_coll, stri_extract_first_coll, stri_extract_first_coll, stri_extract_last_coll, stri_extract_last_coll; stri_extract_words; stri_locate_all_coll, stri_locate_first_coll, stri_locate_first_coll, stri_locate_last_coll, stri_locate_last_coll; stri_locate_boundaries; stri_locate_words; stri_opts_collator; stri_order, stri_sort; stri_replace_all_coll, stri_replace_first_coll, stri_replace_first_coll, stri_replace_last_coll, stri_replace_last_coll; stri_split_boundaries; stri_split_coll; stri_trans_tolower, stri_trans_totitle, stri_trans_toupper; stri_unique; stri_wrap; stringi-locale; stringi-search-coll