I know that the combination of ggplot() and then ggsave() will create and save the plots to the hard drive.
Is there any chance of directly saving the graph to the hard drive without showing/displaying it first?
You have to save the ggplot into a variable, then define plot in ggsave, like so:
testplot <- ggplot(mtcars, aes(cyl, qsec)) + geom_point()
ggsave('test.png', plot = testplot)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With