R/save_as_png.R

#' save_as_png
#'
#' @param plotme plot to be saved
#' @param file path at which plot will be saved
#' @param width im pixels
#' @param height in pixels
#' @param axes boolean that controls axes
#'
#' @return generates an image file at the designated path
#' @export
#'
save_as_png <-
  function(plotme,
           file,
           width = 512,
           height = 512,
           axes = T) {
    grDevices::png(file, width, height)
    graphics::plot(plotme, axes = axes)
    grDevices::dev.off()
  }
grieman/grieman documentation built on May 17, 2019, 8:36 a.m.