notin: Value matching

Description Usage Arguments Value See Also Examples

Description

%in% returns logical vector indicating values that do not have a match. %inx% returns a vector of the values that have a match. %notinx% returns a vector of the values that do not have a match.

Usage

1
2
3
4
5
x %notin% y

x %inx% y

x %notinx% y

Arguments

x

vector or NULL: the values to be matched. Long vectors are supported.

y

vector or NULL: the values to be matched against. Long vectors are not supported.

Value

%notin% 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.

%inx% returns a sub-vector of x with the values that were found in y.

%notinx% returns a sub-vector of x with the values that were not found in y.

See Also

base::match()

Examples

1
2
3
4
vals <- c("a", "notin", 3)
vals %notin% letters
vals %inx% letters
vals %notinx% letters

angeloari/foolsgold documentation built on May 30, 2019, 8:28 a.m.