trim {polmineR} | R Documentation |
Trim an object.
Description
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.
Usage
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
Arguments
.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 |
Format
An object of class character
of length 13.
Author(s)
Andreas Blaette
Examples
use("RcppCWB", corpus = "REUTERS")
dtm <- corpus("REUTERS") %>%
split(s_attribute = "id") %>%
as.DocumentTermMatrix(p_attribute = "word", verbose = FALSE)
trim(dtm, min_doc_length = 100)