Skip to content

Commit

Permalink
allow devasknewpage to be turned off for rmarkdown rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
beckyfisher committed Apr 17, 2024
1 parent 60c8668 commit 27ae6d1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/check_priors.R
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
#'
Expand All @@ -19,7 +21,7 @@
#' }
#'
#' @export
check_priors <- function(object, filename = NA) {
check_priors <- function(object, filename = NA, ask = ask) {
UseMethod("check_priors")
}

Expand Down Expand Up @@ -80,15 +82,15 @@ 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)
}
if (!is.na(filename)) {
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])) +
Expand Down

0 comments on commit 27ae6d1

Please sign in to comment.