nin: %nin%

%nin%R Documentation

%nin%

Description

Convenience 'not-in' operator

Usage

x %nin% y

Arguments

x

vector of items

y

vector of all values

Details

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

Value

logical vector of items in x not in y

Author(s)

Kieran Healy

Examples

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

kjhealy/covdata documentation built on Feb. 4, 2023, 12:52 p.m.