notin: Negated Value Matching

Description Usage Arguments Value Author(s) See Also Examples

Description

%notin% 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 %notin% 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 <solymos@ualberta.ca>

See Also

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

Examples

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

Example output

Loading required package: Matrix
Loading required package: pbapply
mefa4 0.3-5 	 2018-03-24
 [1] FALSE  TRUE FALSE  TRUE FALSE  TRUE  TRUE  TRUE FALSE  TRUE
[1] "ab"  "bba" NA    "@"   "bla" "Ba"  "%"  

mefa4 documentation built on Oct. 7, 2021, 1:06 a.m.