Analogue of %in% but indicating partial match of the left operand.

x %pin% Y

Arguments

x

The values to be matched. Same as %in%.

Y

A vector of values (perl regular expressions) to be matched against.

Value

TRUE for every x for which any grepl is TRUE.

Examples

x <- c("Sydney Airport", "Melbourne Airport") x %pin% c("Syd", "Melb")
#> [1] TRUE TRUE