我有以下数据框:
df <- data.frame(word = c("text1","text2","text3","text3","text3","text3","text3","text3","text3","text3","text3","text3","text3","text3",
"text3","text3","text3","text3","text3","text3"),
freq = c(6500,6400,4500,4400,4000,3800,3300,2900,2300,1200,900,2496,5203,3507,724,1047,725,5739,3927,4085),
stringsAsFactors = FALSE)
并创建以下wordcloud:
cloud2 <- wordcloud(words = df$word, min.freq = 1500,freq = df$freq,random.order=FALSE,
random.color = FALSE, rot.per=0.35, colors= brewer.pal(8,"Dark2"), scale = c(3,0),
vfont=c("sans serif","plain"))
以某种方式,不同的词之间有很大的间隔。因此,一两个词通常不完全可见。 有可能消除较大距离吗? 在类似this link的其他词云中,两个词彼此非常接近。
使用过的软件包:
library(tm)
library(RColorBrewer)
library(wordcloud)