diff --git a/R/plot_to_gtable.R b/R/plot_to_gtable.R index e81711a..1df14f6 100644 --- a/R/plot_to_gtable.R +++ b/R/plot_to_gtable.R @@ -22,9 +22,9 @@ plot_to_gtable <- function(plot){ else { # we convert the captured plot or output plot into a grob # to be safe, we have to save and restore the current graphics device - cur_dev <- dev.cur() + cur_dev <- grDevices::dev.cur() tree <- grid::grid.grabExpr(gridGraphics::grid.echo(plot)) - dev.set(cur_dev) + grDevices::dev.set(cur_dev) u <- grid::unit(1, "null") gt <- gtable::gtable_col(NULL, list(tree), u, u) @@ -40,7 +40,7 @@ plot_to_gtable <- function(plot){ ## so to be absolutely sure, we also save the previous device and then restore it. # save currently active device - cur_dev <- dev.cur() + cur_dev <- grDevices::dev.cur() # open NULL pdf device grDevices::pdf(NULL) # convert plot to grob @@ -48,7 +48,7 @@ plot_to_gtable <- function(plot){ # close pdf device grDevices::dev.off() # restore previously active device - dev.set(cur_dev) + grDevices::dev.set(cur_dev) plot } diff --git a/R/save.R b/R/save.R index 3348cfe..f5fd566 100644 --- a/R/save.R +++ b/R/save.R @@ -28,7 +28,7 @@ ggsave <- function(filename, plot = ggplot2::last_plot(), device = NULL, path = # match ggsave_args to args provided args <- as.list(match.call()) args[[1]] <- NULL # remove the function call - args <- args[na.omit(match(ggsave_args, names(args)))] # remove other args + args <- args[stats::na.omit(match(ggsave_args, names(args)))] # remove other args args_dotdotdot <- list(...) diff --git a/R/setup.R b/R/setup.R index 1e924d8..c0f42c0 100644 --- a/R/setup.R +++ b/R/setup.R @@ -6,5 +6,3 @@ # switch the default theme to theme_cowplot ggplot2::theme_set(theme_cowplot()) } - -.pt <- 1 / 0.352777778 # from ggplot2, file aaa-constants.r diff --git a/man/ggsave.Rd b/man/ggsave.Rd index 98d2bf3..4462bbe 100644 --- a/man/ggsave.Rd +++ b/man/ggsave.Rd @@ -38,5 +38,5 @@ specifying dimensions in pixels.} This function should behave just like \code{ggsave} from ggplot2, with the main difference being that by default it doesn't use the Dingbats font for pdf output. If you ever have trouble with this function, you can -try using \code{ggplot2::ggsave()} instead. +use \code{ggplot2::ggsave()} instead. }