str_weighted_count_match: Weighted count of the words in a vector that are found in...

Description Usage Arguments Value Examples

View source: R/text.table.R

Description

Weighted count of the words in a vector that are found in another vector.

Usage

1

Arguments

x

A list of words and counts created by str_counts(x).

y

A list of words and counts created by str_counts(y).

Value

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.

Examples

1
2
3
4
str_weighted_count_match(
x = str_counts(c("a", "dog", "dog", "went", "to", "the", "store")),
y = str_counts(c("dog", "dog", "dog"))
)

textTools documentation built on Feb. 5, 2021, 5:07 p.m.