grapes-w-grapes.Rd
The operator %w%
checks if the string
on the left-hand side is contained within the
string on the right-hand side.
x %w% y
A character string.
A character vector.
A logical vector, TRUE
if x
is
contained in a given element of y
.
# Check if a string is part of
# another string
"A" %w% "ABC"
#> [1] TRUE
"D" %w% "ABC"
#> [1] FALSE
# Vectorized for y
"A" %w% c("ABC", "DEF", "GHI")
#> [1] TRUE FALSE FALSE