I'm creating a Voronoi tree map using R and I want to save the map as a JPG or PNG image with high resolution in order to publish it in a journal. Below I reported my script to generate the map, could someone help me to modify the scripp adding line to save the map? Thank you for your help.
Thanks, I've tried to use this method but I have some problems with the function webshot2
this is the message when I try to install it:
Warning in install.packages :
package 'webshot2' is not available for this version of R
That message is because you are probably using install.packages("webshot2") and webshot2 is not yet on CRAN.
its on https://github.com/rstudio/webshot2
Hence why I shared the install code using my favoured package manager ("renv" ) . renv is on CRAN so you could install that first and go from there.
if you have remotes package you could also do remotes::install_github("rstudio/webshot2") but I prefer renv.
Yes I use both but with the last comand (webshot(.....)) I have this message:
webshot("myd3.html","mypng.png",delay = 1,selector = "#htmlwidget_container")
Error in getCurrentRegistryId() :
function 'Rcpp_precious_remove' not provided by package 'Rcpp'