Find the length of the set of difference between x
and y
vectors.
count_diff(x, y, ignore.case = FALSE)
A vector to check.
A vector to compare against.
logical; if FALSE
, the pattern matching is case
sensitive and if TRUE
, case is ignored during matching.
The number of unique values of x
not in y
.
sum(x %out% y)
# only unique values are checked
count_diff(c("VT", "NH", "ZZ", "ZZ", "ME"), state.abb)
#> [1] 1