From 3568d09336aae3ba89aaef0f3f411a92107d5320 Mon Sep 17 00:00:00 2001 From: Dmitry Pavlushko Date: Wed, 8 Jun 2016 17:21:41 -0700 Subject: [PATCH] workaround for "Error in dev.hold : cannot open file 'Rplots.pdf'" --- scripts/clustering.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/clustering.R b/scripts/clustering.R index b5b5472..40d1573 100644 --- a/scripts/clustering.R +++ b/scripts/clustering.R @@ -81,13 +81,16 @@ tool_exec <- function(in_params, out_prams) if (!is.null(out_dens) && out_dens != "NA") { arc.progress_label("Calculating density...") - options(device="pdf") + tmp_file = tempfile("density", fileext = ".pdf") options(onefile=FALSE) + pdf(tmp_file) + grid.n <- 100 grid <- surfacePlot(verbose=T, data.xy, parameters = bestModel$parameters, type = "image", what = "density", grid=grid.n, nlevels = 8, transformation = "none", ask=F) dev.off() options(device="windows") options(onefile=NULL) + #file.remove(tmp_file) xy <-list(x = unlist(lapply(grid$x, function(x) rep(x, grid.n))), y = rep(grid$y, grid.n)) arc.progress_label("Writing density dataset...")