%w% | R Documentation |
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
x |
A character string. |
y |
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"
"D" %w% "ABC"
# Vectorized for y
"A" %w% c("ABC", "DEF", "GHI")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.