Skip to content

Commit

Permalink
fix issue #1672
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-buerkner committed Sep 12, 2024
1 parent a3b38f3 commit ab26404
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/priorsense.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab26404

Please sign in to comment.