str_count_positional_match {textTools}R Documentation

Count words from a vector that are found in the same position in another vector.

Description

Count words from a vector that are found in the same position in another vector.

Usage

str_count_positional_match(x, y, ratio = FALSE)

Arguments

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 positional match in y divided by the number of words in x.

Value

A count of the words in x with matches in the same position in y.

Examples

str_count_positional_match(
x = c("a", "dog", "went", "to", "the", "store"),
y = c("this", "dog", "ran", "from", "the", "store")
)

[Package textTools version 0.1.0 Index]