download.file('https://github.com/ywchiu/rtibame/raw/master/kcfor2016.RData', destfile="kcfor2016.RData")
getwd()
## [1] "D:/OS DATA/Desktop"
load("kcfor2016.RData")
library(jiebaR)
## Warning: package 'jiebaR' was built under R version 3.2.5
## Loading required package: jiebaRD
## Warning: package 'jiebaRD' was built under R version 3.2.5
kcfor2016$message = as.character(kcfor2016$message)
mixseg = worker()
content.all <- sapply(kcfor2016$message,  function(e) segment(code= e , jiebar = mixseg))
word <- unlist(content.all)
tb <- table(word)


tb <- sort(tb[tb >=20], decreasing = TRUE)
tb <- tb[nchar(names(tb)) >=2]

繪製文字雲

#edit_dict()
library(wordcloud)
## Warning: package 'wordcloud' was built under R version 3.2.5
## Loading required package: RColorBrewer
wordcloud(names(tb), tb, , min.freq = 1, random.order = F, ordered.colors = F, colors = rainbow(length(1:3)))
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 自來水 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 成為 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 星期六 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 健康 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 落實 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 講者 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 雙溪 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 火車站 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 主題 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 因此 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 協助 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 拜票 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 納稅者 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 然而 could not be fit on page. It will not be
## plotted.
## Warning in wordcloud(names(tb), tb, , min.freq = 1, random.order = F,
## ordered.colors = F, : 進入 could not be fit on page. It will not be
## plotted.