See base::%in% for details. %nin% is a binary operator,
returning a logical vector indicating if there is a negative match or not.
Source
Function retrieved 2026-10-27 from https://stackoverflow.com/a/38352065. Posted by catastrophic-failure, modified by community, see also r-help post https://stat.ethz.ch/pipermail/r-help/2011-May/277498.html. See post 'Timeline' for change history. License - CC BY-SA 4.0. Function documentation written by Elliot Gould and JR Ferrer-Paris.
Arguments
- lhs
vector or NULL: the values to be matched.
Long vectorsare supported.- rhs
vector or NULL: the values to be matched.
Long vectorsare supported.
Author
catastrophic-failure, Elliot Gould and JR Ferrer-Paris.
Examples
"A" %nin% LETTERS[1:10]
#> [1] FALSE
TASVEG_LUT$eligible <- TASVEG_LUT$VEGCODE %nin% c("OAQ", "ORO", "OSM")