Learn R Programming

qdap (version 0.2.5)

exclude: Exclude Elements From a Vector

Description

Quickly exclude words from a word list

Usage

exclude(word.list, ...)

Arguments

word.list
A list of words/terms to exclude from.
...
A vector (character/numeric) if element(s) to be excluded from the word.list.

Value

  • Returns a vector with the excluded terms removed.

Examples

Run this code
exclude(1:10, 3, 4)
exclude(1:10, 3:4)
Top25Words
exclude(Top25Words, qcv(the, of, and))
exclude(Top25Words, "the", "of", "an")

#Using with term.match and termco
terms <- term.match(DATA$state, qcv(th), FALSE)
exclude(terms, "truth")
#all together
termco(DATA$state, DATA$person, exclude(term.match(DATA$state, qcv(th),
    FALSE), "truth"))

MTCH.LST <- exclude(term.match(DATA$state, qcv(th, i)), qcv(truth, stinks))
termco(DATA$state, DATA$person, MTCH.LST)

Run the code above in your browser using DataLab