Negation of the %in% operator, see ?match. %notin% is the negation of %in%, which returns a logical vector indicating if there is a non-match or not for its left operand.

x %notin% table

Arguments

x

vector or NULL: the values to be matched.

table

vector or NULL: the values to be matched against.

Value

A logical vector, indicating if a non-match was located for each element of x: thus the values are TRUE or FALSE and never NA.

Examples

"a" %notin% letters
#> [1] FALSE
"a" %notin% LETTERS
#> [1] TRUE
c("a", "A") %notin% letters
#> [1] FALSE  TRUE
letters %notin% c("a", "b", "c")
#>  [1] FALSE FALSE FALSE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
#> [13]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE
#> [25]  TRUE  TRUE