Skip to content

Commit

Permalink
check formula
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 22, 2024
1 parent d07418e commit af64d2e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions R/check_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ check_model.DHARMa <- check_model.performance_simres

# posterior predictive checks --------------
if (any(c("all", "pp_check") %in% check)) {
dat$PP_CHECK <- .safe(check_predictions(model, ...))
dat$PP_CHECK <- .safe(check_predictions(model, verbose = verbose, ...))
}

dat <- insight::compact_list(dat)
Expand Down Expand Up @@ -552,7 +552,7 @@ check_model.DHARMa <- check_model.performance_simres

# posterior predictive checks --------------
if (any(c("all", "pp_check") %in% check)) {
dat$PP_CHECK <- .safe(check_predictions(model, ...))
dat$PP_CHECK <- .safe(check_predictions(model, verbose = verbose, ...))
}

# binned residuals for bernoulli/binomial --------------
Expand Down
12 changes: 7 additions & 5 deletions R/check_predictions.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@ check_predictions.default <- function(object,
...) {
.is_model_valid(object)
# check_predictions() can't handle exotic formula notation
insight::formula_ok(
object,
action = "error",
prefix_msg = "Posterior predictive checks failed due to an incompatible model formula." # nolint
)
if (verbose) {
insight::formula_ok(
object,
action = "error",
prefix_msg = "Posterior predictive checks failed due to an incompatible model formula." # nolint
)
}

# retrieve model information
minfo <- insight::model_info(object, verbose = FALSE)
Expand Down

0 comments on commit af64d2e

Please sign in to comment.