ggsave()

What is ggsave():

ggsave() is a convenient function for saving a plot. It defaults to saving the last plot that you displayed, using the size of the current graphics device. It also guesses the type of graphics device from the extension.

Usage:

ggsave(
filename,
plot = last_plot(),
device = NULL,
path = NULL,
scale = 1,
width = NA,
height = NA,
units = c(“in”, “cm”, “mm”, “px”),
dpi = 300,
limitsize = TRUE,
bg = NULL,

)

Example;
ggsave(‘market_report.pdf’, width=14, height=12)

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top