The negation of the %in% operator. Returns TRUE for elements of x
that are not in table.
Examples
# Find values not in a set
c(1, 2, 3, 4, 5) %notin% c(2, 4)
#> [1] TRUE FALSE TRUE FALSE TRUE
#> TRUE, FALSE, TRUE, FALSE, TRUE
# Filter data frame rows
df <- data.frame(status = c("Active", "Lapsed", "Active", "Never"))
df[df$status %notin% c("Lapsed", "Never"), ]
#> [1] "Active" "Active"