From ab26404e85ec5728d5fecefa82dbc9ccf1b22c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul-Christian=20B=C3=BCrkner?= Date: Thu, 12 Sep 2024 11:37:48 +0200 Subject: [PATCH] fix issue #1672 --- R/priorsense.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/priorsense.R b/R/priorsense.R index 3353d52e9..019f2915f 100644 --- a/R/priorsense.R +++ b/R/priorsense.R @@ -59,6 +59,11 @@ log_lik_draws.brmsfit <- function(x) { #' @exportS3Method priorsense::log_prior_draws log_prior_draws.brmsfit <- function(x, log_prior_name = "lprior") { + stopifnot(length(log_prior_name) == 1) + if (!log_prior_name %in% variables(x)) { + warning2("Variable '", log_prior_name, "' was not found. ", + "Perhaps you used normalize = FALSE?") + } posterior::subset_draws( posterior::as_draws_array(x), variable = log_prior_name