filter_words: Remove Words Below a Threshold from a...

Description Usage Arguments Value Examples

Description

Remove words from a TermDocumentMatrix or DocumentTermMatrix not meeting a rowSums/ colSums threshold.

Usage

1
filter_words(x, min = 1)

Arguments

x

A TermDocumentMatrix or DocumentTermMatrix.

min

A minimal threshold that a words row/column must sum to.

Value

Returns a TermDocumentMatrix or DocumentTermMatrix.

Examples

1
2
3
4
5
(x <-with(presidential_debates_2012, q_dtm(dialogue, paste(time, tot, sep = "_"))))
filter_words(x)
filter_words(x, 5)
(y <- with(presidential_debates_2012, q_tdm(dialogue, paste(time, tot, sep = "_"))))
filter_words(y, 6)

gofastr documentation built on May 2, 2019, 5:39 a.m.