R/write_plot.R

.write_plot <- function(p, plotpath, ...) {
  if (is.null(plotpath)) {
    print(p)
  } else {
    message("Saving:", plotpath)
    ggsave(plotpath,
           plot = p,
           ...)
  }
}
jongbinjung/ggbuildr documentation built on May 29, 2019, 1:07 a.m.