R/process.R

Defines functions process_plans

process_plans <- function(plans) {
  if (inherits(plans, 'redist_plans')) {
    plans <- attr(plans, 'plans')
  }
  if (!is.numeric(plans)) {
    cli::cli_abort('{.arg plans} should be a numeric vector or matrix.')
  }
  if (!is.matrix(plans)) {
    plans <- as.matrix(plans)
  }
  if (anyNA(plans)) {
    cli::cli_abort('{.val NA} in argument to {.arg plans}.')
  }
  plans
}

Try the redistmetrics package in your browser

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

redistmetrics documentation built on June 8, 2025, 1:26 p.m.