Skip to contents

A binary operator to test if elements of the left-hand vector are not present in the right-hand vector. This is the negation of %in%, and is equivalent to !(x %in% y).

Usage

... %nin% NA

Arguments

x

A vector of values to test.

table

A vector to match against.

Value

A logical vector indicating if elements of x are not in table.

Examples

c("A", "B", "C") %nin% c("B", "D")  # TRUE FALSE TRUE
#> [1]  TRUE FALSE  TRUE
1:5 %nin% c(2, 4)                   # TRUE FALSE TRUE FALSE TRUE
#> [1]  TRUE FALSE  TRUE FALSE  TRUE