简体   繁体   中英

Export wordcloud2 as html automatically?

Is there a way to export word cloud generated by wordcloud2 package as html automatically without having to manually click on Export > Save as Web Page (in RStudio)? Something like saving pdfs with pdf and images with png ?

Here is the code to generate sample wordcloud

require(wordcloud2)
df = head(demoFreq,50)
wordcloud2(df)
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.

It would be best to swiftly move this file to a more permanent home.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM