Find the proportion of values of x
that are %in%
the vector y
.
prop_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 proportion of x
present in y
.
mean(x %in% y)
prop_in(c("VT", "NH", "ZZ", "ME"), state.abb)
#> [1] 0.75