R/plot.R

Defines functions pngplot pdfplot dualplot

Documented in dualplot pdfplot pngplot

#' pngplot
#' @export
pngplot <- function(p, name, h, w) {
  ggplot2::ggsave(p, filename = paste(name, "png", sep = "."), height = h, width = w, family = "Helvetica")
}

#' pdfplot
#' @export
pdfplot <- function(p, name, h, w) {
  ggplot2::ggsave(p, filename = paste(name, "pdf", sep = "."), height = h, width = w, family = "Helvetica")
}

#' dualplot
#' @export
dualplot <- function(p, name, h = 5, w = 8) {
  name <- paste("../inst/plots", name, sep = "/")
  pngplot(p, name, h, w)
  pdfplot(p, name, h, w)
  return(p)
}
mdlincoln/londonauctions documentation built on May 22, 2019, 4:11 p.m.