save_plot()
wraps ggplot2::ggsave()
and offer option to remove white
spaces around figures (creates a additional file in output/figures/trim
;
uses trim_fig
)
save_plot(
object,
filename = NULL,
dir_to_save = NULL,
width = NA,
height = NA,
format = NULL,
units = NULL,
dpi = NULL,
overwrite = FALSE,
trim = FALSE
)
a ggplot object
a character vector with the name of the file to save. Default is NULL and saves with the name of the object
a character vector with the name of the directory to save
a numerical vector with the width of the figure
a numerical vector with the height of the figure
a character vector with format of the figure. Can "jpeg", "tiff", "png" (default), or "pdf"
a character vector with the units of the figure size. Can be "in", "cm" (default), or "mm"
a numerical vector with the resolution of the figure. Default is 300
logical
logical
save_plot()
is derived from
write_plot()
,
available in the excellent
start
project template