Entfernen zu häufiger Wörter (kommen in mehr als 80% der Dokumente vor) in R

Ich arbeite mit dem 'tm'-Paket, um ein Korpus zu erstellen. Ich habe die meisten Vorverarbeitungsschritte durchgeführt. Der Rest besteht darin, zu häufige Wörter zu entfernen (Begriffe, die in mehr als 80% der Dokumente vorkommen). Kann mir jemand dabei helfen?

dsc <- Corpus(dd)
dsc <- tm_map(dsc, stripWhitespace)
dsc <- tm_map(dsc, removePunctuation)
dsc <- tm_map(dsc, removeNumbers)
dsc <- tm_map(dsc, removeWords, otherWords1)
dsc <- tm_map(dsc, removeWords, otherWords2)
dsc <- tm_map(dsc, removeWords, otherWords3)
dsc <- tm_map(dsc, removeWords, javaKeywords)
dsc <- tm_map(dsc, removeWords, stopwords("english"))
dsc = tm_map(dsc, stemDocument)
dtm<- DocumentTermMatrix(dsc, control = list(weighting = weightTf, 
                         stopwords = FALSE))

dtm = removeSparseTerms(dtm, 0.99) 
# ^-  Removes overly rare words (occur in less than 2% of the documents)

Antworten auf die Frage(2)

Ihre Antwort auf die Frage