Count the total values of x that are %in% the vector y.
count_in(x, y, na.rm = TRUE, ignore.case = FALSE)A vector to check.
A vector to compare against.
logical; Should NA be ignored?
logical; if FALSE, the pattern matching is case
sensitive and if TRUE, case is ignored during matching.
The sum of x present in y.
sum(x %out% y)
count_in(c("VT", "NH", "ZZ", "ME"), state.abb)
#> [1] 3