nin function

%nin%

%nin%

Convenience 'not-in' operator

x %nin% y

Arguments

  • x: vector of items
  • y: vector of all values

Returns

logical vecotor of items in x not in y

Details

Complement of the built-in operator %in%. Returns the elements of x that are not in y.

Examples

fruit <- c("apples", "oranges", "banana") "apples" %nin% fruit "pears" %nin% fruit

Author(s)

Kieran Healy

  • Maintainer: Kieran Healy
  • License: MIT + file LICENSE
  • Last published: 2020-06-10