A simple extension of %in%
.
Arguments
- pattern
Character string containing regular expressions to be matched.
- vector
Character vector.
Examples
"Bei" %partin% c("Beijing", "Shanghai") # TRUE
#> [1] TRUE
"bei" %partin% c("Beijing", "Shanghai") # FALSE
#> [1] FALSE
"[aeiou]ng" %partin% c("Beijing", "Shanghai") # TRUE
#> [1] TRUE