Skip to content

Commit

Permalink
update valid formula check
Browse files Browse the repository at this point in the history
  • Loading branch information
venpopov committed Feb 13, 2024
1 parent b191f0e commit d462c6f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions R/helpers-formula.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
#' @return the formula object
#' @keywords internal, developer
check_formula <- function(model, formula) {
# Pre-Check: was a valid brms formula provided
if (inherits(formula, 'brmsformula')) {
stop("The provided formula is a brms formula.
# Pre-Check: was a valid bmm formula provided
if (!inherits(formula, 'bmmformula')) {
if (inherits(formula, 'brmsformula')) {
stop("The provided formula is a brms formula.
Please specify formula with the bmmformula() function instead of
the brmsformula() or bf() function.
E.g.: bmmformula(kappa ~ 1, thetat ~ 1")
E.g.: bmmformula(kappa ~ 1, thetat ~ 1) or bmf(kappa ~ 1, thetat ~ 1)")
} else {
stop("The provided formula is not a valid bmm formula.
Please specify formula with the bmmformula() function.
E.g.: bmmformula(kappa ~ 1, thetat ~ 1) or bmf(kappa ~ 1, thetat ~ 1)")
}
}

# Check: is the formula valid for the specified model type
Expand Down

0 comments on commit d462c6f

Please sign in to comment.