Description Usage Arguments Value Examples
exclude
- Quickly exclude words from a word list
%ex%
- Binary operator version of exclude
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | exclude(word.list, ...)
## S3 method for class 'TermDocumentMatrix'
exclude(word.list, ...)
## S3 method for class 'DocumentTermMatrix'
exclude(word.list, ...)
## S3 method for class 'wfm'
exclude(word.list, ...)
## S3 method for class 'list'
exclude(word.list, ...)
## Default S3 method:
exclude(word.list, ...)
word.list %ex% ...
|
word.list |
A list/vector of words/terms, a |
... |
A vector (character/numeric) if element(s) to be excluded from
the |
Returns a vector with the excluded terms removed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ## Not run:
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)
## Works with wfm
dat <- wfm(DATA$state, DATA$person)
the.no <- term_match(DATA$state, c("the", "no"))
exclude(dat, unlist(the.no))
## Works with tm's TermDocumentMatrix/DocumentTermMatrix
dat2 <- as.dtm(DATA$state, DATA$person)
out.dtm <- exclude(dat2, unlist(the.no))
tm::inspect(out.dtm)
dat3 <- as.tdm(DATA$state, DATA$person)
out.tdm <- exclude(dat3, unlist(the.no))
tm::inspect(out.tdm)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.