Skip to content

Commit 4ff4ab4

Browse files
committed
corrected terms for brms models
1 parent 4e29c92 commit 4ff4ab4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

R/stanova_samples.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ stanova_samples.stanova <- function(
3535
) {
3636
return <- match.arg(return)
3737
if (inherits(object, "brmsfit")) {
38-
all_terms <- tryCatch(
39-
expr = stats::terms(lme4::nobars(object$formula$formula)),
40-
error = function(e) stats::terms(object$formula$formula)
41-
)
38+
if (!requireNamespace("brms")) {
39+
stop("Package brms is required.", call. = FALSE)
40+
}
41+
all_terms <- stats::terms(brms::brmsterms(object$formula)$dpars$mu$fe)
4242
} else if (inherits(object, "stanreg")) {
4343
all_terms <- stats::terms(lme4::nobars(object$formula))
4444
} else {

0 commit comments

Comments
 (0)