I\'ve made different plots (more than a hundred) for a project and I haven\'t capture them on the way (yes it\'s bad , i know). Now, I need to save them all at once but without
I am not sure how Rstudio opens the device where the plot are drawn, but I guess it uses dev.new()
. In that case one quick way to save all opened graphs is to loop through all the devices and write them using dev.print
.
Something like :
lapply(dev.list(),function(d){dev.set(d);dev.print(pdf,file=file.path(folder,paste0("graph_",d,".pdf"))})
where folder
is the path of the folder where you want to store your graph (could be for example folder="~"
if you are in linux and want to store all your graph in your home folder).