expand_matrix_text: Create a term-by-term matrix.

Description Usage Arguments Examples

View source: R/wordly_functions.R

Description

Takes in two documents or two lists of words and creates a matrix of all possible word-by-word combinations. Used primarily by 'leven_dist' function.

Usage

1
2
expand_matrix_text(text_1, text_2, stop_words = NULL,
  make_lower = TRUE, rem_punct = TRUE, rem_num = FALSE)

Arguments

text_1

The first list of words or document input.

text_2

The second list of words or document input.

stop_words

A list of stop words to be used. Defaults to no stop words used (NULL).

make_lower

Should text be converted to lower case? Defaults to TRUE.

rem_punct

Should punctuation be removed? Defaults to TRUE.

rem_num

Should numerics be removed? Defaults to TRUE.

Examples

1
2
expand_matrix_text(c("duck", "pig", "cat"), c("dog", "cat"))
expand_matrix_text("HEllo I'm me", "hI tHeRe")

tomathon-io/wordly documentation built on June 15, 2020, 12:41 a.m.