Is pdf() the function underpinning export>save to pdf button in Rstudio?

Viewed 44

Is this Rstudio "Save as PDF" button

enter image description here

internally calling the pdf() function? Thus, would it be equivalent to this chunk of code?:

calibration_simple_plot %>% pdf(file = "plots/ch4/forecasts.pdf",
    width = 6, # The width of the plot in inches
    height = 8) # The height of the plot in inches
dev.off()

I would like to automate my saving to PDF process. I am also confused if using Cairo PDF is a better option.

0 Answers
Related