Skip to contents

This function saves the specified plots built using ggplot2 as png, pdf, and svg files. You can specify subfolders for each data subset or store plots however you want in the plot directory.

Usage

save.ggplot(
  filename,
  plot = last_plot(),
  path = paste0(getwd(), "/plots"),
  height = NA,
  width = NA
)

Arguments

filename

What you want the saved plot to be named

plot

Name of the plot object to be saved

path

Path to the designated plot folder. These is where subfolders will be built for each plot file type.

height

Plot height

width

Plot width