From af64d2e9a9f664b56efb26a17f7af3e75e234892 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 22 Nov 2024 14:57:22 +0100 Subject: [PATCH] check formula --- R/check_model.R | 4 ++-- R/check_predictions.R | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/R/check_model.R b/R/check_model.R index daa1255fc..f769b95e3 100644 --- a/R/check_model.R +++ b/R/check_model.R @@ -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) @@ -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 -------------- diff --git a/R/check_predictions.R b/R/check_predictions.R index 45700313e..b39cd6458 100644 --- a/R/check_predictions.R +++ b/R/check_predictions.R @@ -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)