将wordcloud2自动导出为html?

d.b*_*d.b 3 plot r

有没有办法自动导出wordcloud2包生成的文字云html而无需手动点击Export> Save as Web Page(在RStudio中)?像保存pdf pdf和图像一样png

这是生成示例wordcloud的代码

require(wordcloud2)
df = head(demoFreq,50)
wordcloud2(df)
Run Code Online (Sandbox Code Playgroud)

Chr*_*sss 5

require(wordcloud2)
df       <- head(demoFreq, 5)
my_cloud <- wordcloud2(df)
my_path  <- htmltools::html_print(my_cloud) # saves html in temp directory
print(my_path) # the location of the html file.
Run Code Online (Sandbox Code Playgroud)

最好迅速将此文件移动到更永久的家中.