removeSparseTerms

0th

Percentile

Remove Sparse Terms from a Term-Document Matrix

Remove sparse terms from a document-term or term-document matrix.

Usage
removeSparseTerms(x, sparse)
Arguments
x

A DocumentTermMatrix or a TermDocumentMatrix.

sparse

A numeric for the maximal allowed sparsity in the range from bigger zero to smaller one.

Value

A term-document matrix where those terms from x are removed which have at least a sparse percentage of empty (i.e., terms occurring 0 times in a document) elements. I.e., the resulting matrix contains only terms with a sparse factor of less than sparse.

Aliases
  • removeSparseTerms
Examples
# NOT RUN {
data("crude")
tdm <- TermDocumentMatrix(crude)
removeSparseTerms(tdm, 0.2)
# }
Documentation reproduced from package tm, version 0.7-3, License: GPL-3

Community examples

Looks like there are no examples yet.