diff --git a/R/save.r b/R/save.r index c975d83cc6..2d397bf04b 100644 --- a/R/save.r +++ b/R/save.r @@ -173,8 +173,10 @@ plot_dev <- function(device, filename = NULL, dpi = 300, call = caller_env()) { if ("units" %in% names(args)) { call_args$units <- 'in' } - args <- modify_list(list(...), call_args) - dev <- function(...) inject(device(!!!args)) + dev <- function(...) { + args <- modify_list(list(...), call_args) + inject(device(!!!args)) + } return(dev) }