From 48ff25ee8114a5193c67e96e031ff836d4b719c3 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 22 Jan 2021 14:40:42 +0100 Subject: We do not need to suppress saemix plots any more This makes fitting with saem within parallel::mclapply much faster and, surprisingly, much less hungry for RAM. --- R/saem.R | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'R') diff --git a/R/saem.R b/R/saem.R index ffdd5503..fd2a77b4 100644 --- a/R/saem.R +++ b/R/saem.R @@ -28,8 +28,6 @@ utils::globalVariables(c("predicted", "std")) #' automatic choice is not desired #' @param quiet Should we suppress the messages saemix prints at the beginning #' and the end of the optimisation process? -#' @param suppressPlot Should we suppress any plotting that is done -#' by the saemix function? #' @param control Passed to [saemix::saemix] #' @param \dots Further parameters passed to [saemix::saemixModel]. #' @return An S3 object of class 'saem.mmkin', containing the fitted @@ -109,7 +107,7 @@ saem.mmkin <- function(object, solution_type = "auto", control = list(displayProgress = FALSE, print = FALSE, save = FALSE, save.graphs = FALSE), - verbose = FALSE, suppressPlot = TRUE, quiet = FALSE, ...) + verbose = FALSE, quiet = FALSE, ...) { transformations <- match.arg(transformations) m_saemix <- saemix_model(object, verbose = verbose, @@ -117,15 +115,6 @@ saem.mmkin <- function(object, transformations = transformations, ...) d_saemix <- saemix_data(object, verbose = verbose) - if (suppressPlot) { - # We suppress the log-likelihood curve that saemix currently - # produces at the end of the fit by plotting to a file - # that we discard afterwards - tmp <- tempfile() - grDevices::png(tmp) - on.exit(grDevices::dev.off()) - on.exit(unlink(tmp), add = TRUE) - } fit_time <- system.time({ utils::capture.output(f_saemix <- saemix::saemix(m_saemix, d_saemix, control), split = !quiet) }) -- cgit v1.2.1