我能夠製作單詞雲,但是我的問題是當我記錄單詞數量的頻率時,我得到的單詞頻率是1.我想要單詞的頻率大於2。我可以這樣做嗎?從R中的文字雲中刪除單詞
tdm只是一個術語矩陣。我試過的東西像rowSums(m>2)
,但其沒有工作
# define tdm as matrix
m = as.matrix(tdm)
# get word counts in decreasing order
word_freqs = sort(rowSums(m), decreasing=TRUE)
# create a data frame with words and their frequencies
dm = data.frame(word=names(word_freqs), freq=word_freqs)
試圖從https://sites.google.com/site/miningtwitter/questions/talking-about/wordclouds/wordcloud1
這裏看看: http://groupspaces.com/KCRUsersGroup/wiki/wordcloud –