equality: A stronger element-wise equality operators

Description Usage Arguments Value Examples

Description

These operators work like == or != but they handle comparison with NA values. 1 %===% NA is FALSE and NA %===% NA is TRUE.

Usage

1
2
3
x %===% y

x %!==% y

Arguments

x, y

vectors to be compared. They must have the same length.

Value

%===% returns TRUE wherever is x[i] the same as y[i] and %!==% returns FALSE wherever is x[i] the same as y[i].

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
1:3  %===% 1:3
#> [1] TRUE TRUE TRUE

1:3 %===% 4:6
#> [1] FALSE FALSE FALSE

c(NA, NaN) %===% c(NA, NaN)
#> [1] TRUE TRUE

c(NA, 1) %===% c(1, NA)
#> [1] FALSE FALSE

LearningToTalk/L2TDatabase documentation built on June 24, 2020, 3:45 a.m.