From 894626cc315282365678701c6d8a2f7b66606052 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 24 May 2024 09:21:41 +0200 Subject: [PATCH] pass verbose --- DESCRIPTION | 2 +- R/describe_posterior.R | 2 +- R/si.R | 4 +--- R/utils_bayesfactor.R | 8 ++++++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4013aff86..aed956122 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: bayestestR Title: Understand and Describe Bayesian Models and Posterior Distributions -Version: 0.13.2.1 +Version: 0.13.2.2 Authors@R: c(person(given = "Dominique", family = "Makowski", diff --git a/R/describe_posterior.R b/R/describe_posterior.R index 83296e60f..3e8d82209 100644 --- a/R/describe_posterior.R +++ b/R/describe_posterior.R @@ -787,7 +787,7 @@ describe_posterior.emmGrid <- function(posterior, ...) { if (any(c("all", "bf", "bayesfactor", "bayes_factor") %in% tolower(test)) || "si" %in% tolower(ci_method)) { - samps <- .clean_priors_and_posteriors(posterior, bf_prior) + samps <- .clean_priors_and_posteriors(posterior, bf_prior, verbose = verbose) bf_prior <- samps$prior posterior_samples <- samps$posterior } else { diff --git a/R/si.R b/R/si.R index 1aac876b6..62ae04a2f 100644 --- a/R/si.R +++ b/R/si.R @@ -160,9 +160,7 @@ si.blavaan <- si.stanreg #' @export si.emmGrid <- function(posterior, prior = NULL, BF = 1, verbose = TRUE, ...) { - samps <- .clean_priors_and_posteriors(posterior, prior, - verbose = verbose - ) + samps <- .clean_priors_and_posteriors(posterior, prior, verbose = verbose) # Get SIs out <- si.data.frame( diff --git a/R/utils_bayesfactor.R b/R/utils_bayesfactor.R index 8bf6075ef..a97ef30e9 100644 --- a/R/utils_bayesfactor.R +++ b/R/utils_bayesfactor.R @@ -70,7 +70,9 @@ if (is.null(prior)) { prior <- posterior - insight::format_warning("Prior not specified! Please provide the original model to get meaningful results.") + if (verbose) { + insight::format_warning("Prior not specified! Please provide the original model to get meaningful results.") + } } @@ -129,7 +131,9 @@ verbose = TRUE, ...) { if (is.null(prior)) { prior <- posterior - insight::format_warning("Prior not specified! Please provide the original model to get meaningful results.") + if (verbose) { + insight::format_warning("Prior not specified! Please provide the original model to get meaningful results.") + } } if (!inherits(prior, "emm_list")) {