问题
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