R/04-get_disagg_column.R

Defines functions .get_disagg_column

#' Get the column number for the disaggregation
#'
#' @param wrp_disagg_col numeric reflecting which disaggregation has been
#' selected.
#'
#' @noRd

.get_disagg_column <- function(wrp_disagg_col) {
  if (!(wrp_disagg_col %in% 0:9)) {
    message("INPUT ERROR: `disaggregation` must be an 
            integer between 0 and 9.\nSee `?wrp_get` for help.")
    return(-1)
  }
  if (wrp_disagg_col > 0) {
    wrp_disagg_col <- .pkgenv$wrp$wrp_disaggregations$pos[wrp_disagg_col]
  }
  return(wrp_disagg_col)
}

Try the worldriskpollr package in your browser

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

worldriskpollr documentation built on April 3, 2023, 5:41 p.m.