From 8d41dfddb26b22679356234085b94d00850518f4 Mon Sep 17 00:00:00 2001 From: Schultheis Date: Thu, 28 Jun 2018 14:13:43 +0200 Subject: [PATCH] download: restore wd on exit --- R/function.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/function.R b/R/function.R index 1aed7cf..8152510 100644 --- a/R/function.R +++ b/R/function.R @@ -1234,6 +1234,7 @@ download <- function(file, filename, plot, width, height, ppi = 72, save_plot = # plotly # change working directory temporary so mounted drives are not a problem wd <- getwd() + on.exit(setwd(wd)) # make sure working directory will be restored setwd(tempdir()) plotly::export(p = plot, file = plot_file_pdf) plotly::export(p = plot, file = plot_file_png)