当我想导出wordcloud2图片时,单词云似乎被重新计算过,看起来与查看器中的完全不同。
如何防止R创建另一张图片?
library(wordcloud2)
wordcloud2(demoFreq[demoFreq$freq>7,],minRotation = 0, maxRotation = 0)Pictures: https://drive.switch.ch/index.php/s/8WIkGEM88wd4UXc
发布于 2018-02-07 18:29:28
您只需在函数中添加shuffle = FALSE,以防您想要控制颜色,您可以使用rainbow函数创建一个带有数据输入行数的调色板:
dataInput <- demoFreq[demoFreq$freq>7,]
my_colors <- rainbow(nrow(dataInput), start = 0.1) # check ?rainbow for more infos
wordcloud2(dataInput, minRotation = 0, maxRotation = 0, shuffle = F, color = my_colors)为您提供:

希望这能有所帮助!
发布于 2018-02-08 20:33:07
添加shuffle = FALSE可以保持单词不变。定义非随机颜色可以修复颜色。也许可以使用颜色矢量。
library(wordcloud2)
minfreq=10
upperpart= demoFreq[demoFreq$freq>minfreq,]
colorvector = rep(c('red','skyblue'), length.out=nrow(upperpart))
wordcloud2(demoFreq[demoFreq$freq>minfreq,],minRotation = 0,
maxRotation = 0,shuffle=FALSE, color=colorvector)https://stackoverflow.com/questions/48660145
复制相似问题