R/utils_interpret.R

Defines functions .match.rules

#' @keywords internal
.match.rules <- function(rules, choices) {
  if (is.rules(rules)) {
    return(rules)
  }

  rule <- pmatch(rules, names(choices))

  if (!is.character(rules) || length(rules) != 1 || is.na(rule)) {
    insight::format_error(
      sprintf(
        "'rules' must be %s or an object of type 'rules'.",
        paste0("'", names(choices), "'", collapse = ", ")
      )
    )
  }

  choices[[rule]]
}

Try the effectsize package in your browser

Any scripts or data that you put into this service are public.

effectsize documentation built on July 3, 2024, 9:07 a.m.