Convenience 'not-in' operator
x %nin% y
vector of items
vector of all values
logical vector of items in x not in y
Complement of the built-in operator %in%
. Returns the elements of x
that are not in y
.
fruit <- c("apples", "oranges", "banana")
"apples" %nin% fruit
#> [1] FALSE
"pears" %nin% fruit
#> [1] TRUE