Learn R Programming

qdap (version 2.2.1)

common: Find Common Words Between Groups

Description

Find common words between grouping variables (e.g., people).

Usage

common(word.list, overlap = "all", equal.or = "more", ...)

Arguments

word.list
A list of named character vectors.
overlap
Minimum/exact amount of overlap.
equal.or
A character vector of c("equal", "greater", "more", "less").
...
In lieu of word.list the user may input n number of character vectors.

Value

  • Returns a dataframe of all words that match the criteria set by overlap and equal.or.

Examples

Run this code
a <- c("a", "cat", "dog", "the", "the")
b <- c("corn", "a", "chicken", "the")
d <- c("house", "feed", "a", "the", "chicken")
common(a, b, d, overlap=2)
common(a, b, d, overlap=3)

r <- list(a, b, d)
common(r)
common(r, overlap=2)

common(word_list(DATA$state, DATA$person)$cwl, overlap = 2)

Run the code above in your browser using DataLab