An easier and more logical way to express "elements of object X not in object Y"; %in% and %nin% are wrappers for match; returns a vector of booleans.
x %nin% table
x | vector or |
---|---|
table | vector or |
%in%
, match
1:10 %nin% 5:15#> [1] TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSEwhich(1:10 %nin% 5:15)#> [1] 1 2 3 4