How to Save the wordcloud in R [duplicate]

╄→尐↘猪︶ㄣ 提交于 2019-12-08 11:35:35

问题


Can you please help to save word cloud on my local drive as an image?, I am looking for a code/command to get it done automatically through R Programming. I have tried with saveWidget, plotly, orca but not get success.

I have used below code to create the word cloud.

library(wordcloud2)
wordcloud2(demoFreqC, figPath = figPath,color = "orangered",fontFamily = "Miso")

回答1:


The procedure is outlined here. Briefly:

install.packages("webshot")
webshot::install_phantomjs()
library(wordcloud2)
hw <- wordcloud2(demoFreq,size = 3)
saveWidget(hw,"1.html",selfcontained = F)
webshot::webshot("1.html","1.png",vwidth = 1992, vheight = 1744, delay =10)



回答2:


If you are using RStudio, there is an option to import the output as image on the IDE itself.




回答3:


in R studio there is an option to export the plot in JPG or PNG format with the image size you want.



来源:https://stackoverflow.com/questions/51759893/how-to-save-the-wordcloud-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!