Return the values of x
that are %in%
of the vector y
.
what_in(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 elements of x
that are %in%
y.
x[which(x %in% y)]
what_in(c("VT", "DC", NA), state.abb)
#> [1] "VT"