diff --git a/DESCRIPTION b/DESCRIPTION index 7a625b9..6e65578 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -12,12 +12,15 @@ Description: Some helpful extensions and modifications to the 'ggplot2' package name, which stands for Claus O. Wilke's plot library. URL: https://github.com/wilkelab/cowplot Depends: - R (>= 3.0.0), - ggplot2 (>= 1.0.0) + R (>= 3.2.0), + ggplot2 (>= 1.0.0), Imports: grid (>= 3.0.0), gtable (>= 0.1.2), - plyr (>= 1.8.2) + plyr (>= 1.8.2), + grDevices, + methods, + utils License: GPL-2 LazyData: true Suggests: diff --git a/R/draw.R b/R/draw.R index c2489ab..84aeb2e 100644 --- a/R/draw.R +++ b/R/draw.R @@ -6,7 +6,7 @@ # ****** Internal functions used by drawing code ****** ggplot_to_gtable <- function(plot) { - if (is(plot, "ggplot")){ + if (methods::is(plot, "ggplot")){ ggplot2::ggplotGrob(plot) } else if (is(plot, "gtable")){ diff --git a/R/save.R b/R/save.R index 67e1a1d..88902bf 100644 --- a/R/save.R +++ b/R/save.R @@ -25,7 +25,7 @@ #' @export ggsave <- function(filename = NULL, plot = ggplot2::last_plot(), device = default_device(filename), path = NULL, scale = 1, - width = par("din")[1], height = par("din")[2], units = c("in", "cm", "mm"), + width = graphics::par("din")[1], height = graphics::par("din")[2], units = c("in", "cm", "mm"), dpi = 300, limitsize = TRUE, ...) { # this code is copied directly from ggplot2. ugly, but # the only way to implement this properly. @@ -109,7 +109,7 @@ ggsave <- function(filename = NULL, plot = ggplot2::last_plot(), filename <- file.path(path, filename) } device(file=filename, width=width, height=height, ...) - on.exit(capture.output(dev.off())) + on.exit(utils::capture.output(grDevices::dev.off())) print(plot) invisible() diff --git a/man/ggsave.Rd b/man/ggsave.Rd index 7a642b2..1c12aaf 100644 --- a/man/ggsave.Rd +++ b/man/ggsave.Rd @@ -6,8 +6,8 @@ \usage{ ggsave(filename = NULL, plot = ggplot2::last_plot(), device = default_device(filename), path = NULL, scale = 1, - width = par("din")[1], height = par("din")[2], units = c("in", "cm", - "mm"), dpi = 300, limitsize = TRUE, ...) + width = graphics::par("din")[1], height = graphics::par("din")[2], + units = c("in", "cm", "mm"), dpi = 300, limitsize = TRUE, ...) } \arguments{ \item{filename}{Filename of plot}