Description Usage Arguments Value Examples
Count the words in a vector that are found in another vector.
1 | str_count_match(x, y, ratio = FALSE)
|
x |
A vector of words. |
y |
A vector of words to test against. |
ratio |
TRUE/FALSE, if TRUE, returns the number of words in x with a match in y divided by the number of words in x. |
A number, the count of words in x also in y
1 2 3 4 5 6 7 8 9 | str_count_match(
x = c("a", "dog", "went", "to", "the", "store"),
y = c("dog", "to", "store")
)
str_count_match(
x = c("a", "dog", "went", "to", "the", "store"),
y = c("dog", "to", "store"),
ratio = TRUE
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.