trim | R Documentation |
Method to trim and adjust objects by applying thresholds, minimum frequencies
etc. It can be applied to context
, features
, context
, partition
and
partition_bundle
objects.
trim(.Object, ...)
## S4 method for signature 'TermDocumentMatrix'
trim(
.Object,
terms_to_drop,
docs_to_keep,
min_count,
min_doc_length,
verbose = TRUE,
...
)
## S4 method for signature 'DocumentTermMatrix'
trim(
.Object,
terms_to_drop,
docs_to_keep,
min_count,
min_doc_length,
verbose = TRUE,
...
)
punctuation
.Object |
The object to be trimmed |
... |
further arguments |
terms_to_drop |
A |
docs_to_keep |
A |
min_count |
A |
min_doc_length |
A |
verbose |
A |
An object of class character
of length 13.
Andreas Blaette
use("RcppCWB", corpus = "REUTERS")
dtm <- corpus("REUTERS") %>%
split(s_attribute = "id") %>%
as.DocumentTermMatrix(p_attribute = "word", verbose = FALSE)
trim(dtm, min_doc_length = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.