Check whether an object is absent from a table, i.e., the logical inverse of in
. See examples on how missing values are being handled.
Arguments
- x
Vector or NULL
: the values to be matched.
- table
Vector or NULL
: the values to be matched against.
Value
Logical vector, TRUE
for each element of x
absent from table
, and FALSE
for each element of x
present in table
.
Examples
11 %notin% 1:10 # TRUE
#> [1] TRUE
"a" %notin% c("a", "b") # FALSE
#> [1] FALSE
## NAs on the LHS
NA %in% 1:2
#> [1] FALSE
NA %notin% 1:2
#> [1] TRUE
## NAs on the RHS
NA %in% c(1:2,NA)
#> [1] TRUE
NA %notin% c(1:2,NA)
#> [1] FALSE