%nin% is the complement to %in%. It looks which values in x do not match (hence, are not in) values in y.

x %nin% y

Arguments

x

Vector with values to be matched.

y

Vector with values to be matched against.

Value

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

Details

See 'Details' in match.

Examples

c("a", "B", "c") %in% letters
#> [1]  TRUE FALSE  TRUE
c("a", "B", "c") %nin% letters
#> [1] FALSE  TRUE FALSE

c(1, 2, 3, 4) %in% c(3, 4, 5, 6)
#> [1] FALSE FALSE  TRUE  TRUE
c(1, 2, 3, 4) %nin% c(3, 4, 5, 6)
#> [1]  TRUE  TRUE FALSE FALSE