str_weighted_count_match {textTools} | R Documentation |
Weighted count of the words in a vector that are found in another vector.
str_weighted_count_match(x, y)
x |
A list of words and counts created by str_counts(x). |
y |
A list of words and counts created by str_counts(y). |
A number, the count of words in x also in y scaled by the number of times each word appears in x and y. If a word appears 3 times in x and 2 times in y, the result is 6, assuming no other words match.
str_weighted_count_match(
x = str_counts(c("a", "dog", "dog", "went", "to", "the", "store")),
y = str_counts(c("dog", "dog", "dog"))
)