R/utils_formulas.R

Defines functions assert_formula parse_formula

Documented in parse_formula

#' Asserts formula and extract variables
#'
#' @inheritParams predict_general_mdl
parse_formula <- function(formula) {
  assert_formula(formula)
  all.vars(formula)
}


#' @noRd
assert_formula <- function(x) {
  if (!inherits(x, "formula")) {
    stop(sprintf("`formula` must be a formula object, not a %s.",
                 class(x)),
         call. = FALSE)
  }
}
caldwellst/augury documentation built on Oct. 10, 2024, 8:20 a.m.