user36729
user36729

Reputation: 575

Build a document-term-matrix based on most frequent terms in R

I built a document-term-matrix with tm package in R. There are 18000 terms and most of them are not frequent. I want to remove the terms with less than 0.0001 frequency in order to decrease the number of columns.

Upvotes: 0

Views: 736

Answers (1)

raha.rah
raha.rah

Reputation: 428

removeSparseTerms(DocumentTermMatrix(corpus),0.995)

and you can change sparse argument as you like for your problem

Upvotes: 0

Related Questions