R/write_plot.R

.write_plot <- function(p, plotpath, ...) {
  if (is.null(plotpath)) {
    print(p)
  } else {
    message("Saving:", plotpath)
    ggsave(plotpath,
           plot = p,
           ...)
  }
}

Try the ggbuildr package in your browser

Any scripts or data that you put into this service are public.

ggbuildr documentation built on May 2, 2019, 11 a.m.