Wordcloud2 R:在 rstudio、savewidget 和 webshot 中保存相同的图像

问题描述

我想将 Rstudio 中的 wordcloud2 视图保存为 html 和 PNG 文件

我正在关注这篇文章中的答案,使用 wordcloud2、htmlwidgets 和 webshot 库:How to Save the wordcloud in R

    library(wordcloud2)
    library(htmlwidgets)
    library(webshot)
    
    set.seed(1)
    plot <- wordcloud2(word,freq,size = 1,minRotation = 0,maxRotation = 0,shuffle = FALSE,color = rainbow(nrow(word))
    print(plot)
    
    saveWidget(plot,"test.html",selfcontained = FALSE)
    webshot("test.html","test.png",delay=15)

我面临的问题是,每个可视化在单词的位置方面都略有不同。 有没有办法在保存步骤中避免这种随机性?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)