如何根据出现频率(x轴)而不是根据术语的字母顺序(y轴)来排列qplot中的条形图?
# create a table to store the top 50 most frequent words and plot a barchart
word_freqs = sort(rowSums(tdm), decreasing=TRUE)
top50words <- head(word_freqs, 50)
termFrequency <- rowSums(as.matrix(top50words))
qplot(names(termFrequency), termFrequency, geom="bar", xlab="Terms") + coord_flip()
top50words 已经按降序排列术语(从大多数出现次数到最少出现次数。但是,在qplot中,它按照字母顺序排列。