From 27ae6d1d4b762b12e1e50ac9b14beba069d8940d Mon Sep 17 00:00:00 2001 From: Rebecca Fisher Date: Wed, 17 Apr 2024 10:06:43 +0800 Subject: [PATCH] allow devasknewpage to be turned off for rmarkdown rendering --- R/check_priors.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/R/check_priors.R b/R/check_priors.R index 74251ffc..d56d6566 100644 --- a/R/check_priors.R +++ b/R/check_priors.R @@ -6,6 +6,8 @@ #' @param filename An optional \code{\link[base]{character}} vector to be used #' as a pdf filename in the case of a \code{\link{bayesmanecfit}}. Any non #' empty character string will indicate the user wants to save the plots. +#' @param ask Should the user be asked to hit enter for next page for a +#' \code{\link{bayesmanecfit}} object? #' #' @seealso \code{\link{bnec}} #' @@ -19,7 +21,7 @@ #' } #' #' @export -check_priors <- function(object, filename = NA) { +check_priors <- function(object, filename = NA, ask = ask) { UseMethod("check_priors") } @@ -80,7 +82,7 @@ check_priors.bayesnecfit <- function(object, filename = NA) { #' @noRd #' #' @export -check_priors.bayesmanecfit <- function(object, filename = NA) { +check_priors.bayesmanecfit <- function(object, filename = NA, ask = TRUE) { if (!is.na(filename)) { chk_character(filename) } @@ -88,7 +90,7 @@ check_priors.bayesmanecfit <- function(object, filename = NA) { pdf(file = paste(filename, ".pdf", sep = ""), onefile = TRUE, width = 12, height = 4) } else { - devAskNewPage(ask = TRUE) + devAskNewPage(ask = ask) } for (m in seq_len(length(object$mod_fits))) { out_plot <- check_priors(object = pull_out(object, model = names(object$mod_fits)[m])) +