R删除Wordcloud中单词之间的距离

问题描述 投票:1回答:1

我有以下数据帧:

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"))

不知何故,不同的词之间有很大的空间。因此,一两个词通常不完全可见。 enter image description here有可能移除很远的距离吗?在像this link这样的其他wordcloud中,单词彼此非常接近。

二手包装:

library(tm)
library(RColorBrewer)
library(wordcloud)
r word-cloud
1个回答
0
投票

这里没问题。

R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 Service Pack 1


other attached packages:
wordcloud_2.5 

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.