save_plot: Save a 'ggplot' Object

View source: R/save_plot.R

save_plotR Documentation

Save a ggplot Object

Description

save_plot() saves a ggplot object to the specified path. It is a wrapper around ggsave() that takes the plot as the first argument and provides alternate defaults for use in SCHD slides. Unlike ggsave() the ggplot object must always be supplied explicitly, and it will not overwrite existing files by default.

Usage

save_plot(gg_obj, path, width = 16, height = 9, force = FALSE, ...)

Arguments

gg_obj

A ggplot object to save

path

The location for saving

width

The width of the saved figure, in inches by default

height

The height of the saved figure, in inches by default

force

Should existing files be overwritten?

...

Additional arguments to pass to ggsave()

Value

The gg_obj, invisibly


jesse-smith/covidReport documentation built on Aug. 3, 2024, 4:52 p.m.