transform_filter_commons: Remove terms from a document-term matrix

Description Usage Arguments See Also


This function removes very common and very uncommon words from a document-term matrix.


transform_filter_commons(dtm, term_freq = c(uncommon = 0.001, common = 0.975))



a document-term matrix of class dgCMatrix or dgTMatrix.


numeric vector of 2 values in between 0 and 1. The first element corresponds to frequency of uncommon words; the second element corresponds to the frequency of common words. Terms which are observed less than first value or frequency or more than second will be filtered out.

See Also

prune_vocabulary, transform_tf, transform_tfidf, transform_binary

Search within the text2vec package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.