【发布时间】:2016-04-06 13:59:11
【问题描述】:
我想制作以下数据框的 wordcloud(比如 DF):
MAKE TYPE PRICE
___________________________
subaru hatchback 36
chevrolet hatchback 53
mazda truck 31
toyota hatchback 39
mitsubishi bus 41
honda hatchback 42
nissan sedan 37
dodge hatchback 41
plymouth hatchback 41
maruti lorry 38
mitsubishi hatchback 38
dodge mini bus 38
plymouth hatchback 38
我的做法如下:
library(tm)
library(SnowballC)
library(wordcloud)
teleCorpus <- Corpus(VectorSource(DF$TYPE))
teleCorpus <- tm_map(teleCorpus, PlainTextDocument)
wordcloud(teleCorpus, max.words = 100, random.order = FALSE)
我想让它看起来更漂亮和多彩。
有人可以帮忙吗,如何以不同于上面的方式???
【问题讨论】:
-
您可以简单地从 quanteda 包中调用 dtm 上的 plot()。
标签: r corpus word-cloud