Learn R Programming

textTools (version 0.1.0)

str_any_match: Detect if there are any words in a vector also found in another vector.

Description

Detect if there are any words in a vector also found in another vector.

Usage

str_any_match(x, y)

Arguments

x

A vector of words.

y

A vector of words to test against.

Value

TRUE/FALSE, TRUE if any words in x are also in y

Examples

Run this code
# NOT RUN {
str_any_match(
x = c("a", "dog", "went", "to", "the", "store"),
y = c("the")
)
str_any_match(
x = c("a", "dog", "went", "to", "the", "store"),
y = c("apple")
)
# }

Run the code above in your browser using DataLab