oper_comparison: Compare Strings with or without Collation

Description Usage Arguments Details Value See Also Examples

Description

Relational operators for comparing corresponding strings in two character vectors, with a typical R look-and-feel.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
e1 %s<% e2

e1 %s<=% e2

e1 %s>% e2

e1 %s>=% e2

e1 %s==% e2

e1 %s!=% e2

e1 %s===% e2

e1 %s!==% e2

e1 %stri<% e2

e1 %stri<=% e2

e1 %stri>% e2

e1 %stri>=% e2

e1 %stri==% e2

e1 %stri!=% e2

e1 %stri===% e2

e1 %stri!==% e2

Arguments

e1, e2

character vectors or objects coercible to character vectors

Details

These functions call stri_cmp_le or its friends, using the default collator options. As a consequence, they are vectorized over e1 and e2.

%stri==% tests for canonical equivalence of strings (see stri_cmp_equiv) and is a locale-dependent operation.

%stri===% performs a locale-independent, code point-based comparison.

Value

All the functions return a logical vector indicating the result of a pairwise comparison. As usual, the elements of shorter vectors are recycled if necessary.

See Also

Other locale_sensitive: stri_compare(), stri_count_boundaries(), stri_duplicated(), stri_enc_detect2(), stri_extract_all_boundaries(), stri_locate_all_boundaries(), stri_opts_collator(), stri_order(), stri_sort(), stri_split_boundaries(), stri_trans_tolower(), stri_unique(), stri_wrap(), stringi-locale, stringi-search-boundaries, stringi-search-coll

Examples

1
2
"a" %stri<% "b"
c("a", "b", "c") %stri>=% "b"

stringi documentation built on Feb. 18, 2020, 1:06 a.m.