ni: Negated Value Matching

Description Usage Arguments Value Author(s) See Also Examples

Description

%ni% is the negation of %in%, which returns a logical vector indicating if there is a non-match or not for its left operand.

Usage

1
x %ni% table

Arguments

x

vector or NULL: the values to be matched.

table

vector or NULL: the values to be matched against.

Value

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

Author(s)

Peter Solymos <[email protected]>

See Also

All the opposite of what is written for %in%.

See relational operators for intervals: %[]%.

Examples

1
2
3
1:10 %ni% c(1,3,5,9)
sstr <- c("c","ab","B","bba","c",NA,"@","bla","a","Ba","%")
sstr[sstr %ni% c(letters, LETTERS)]

intrval documentation built on May 29, 2017, 8:30 p.m.