R/check_uniform_bin_size.R

Defines functions check_uniform_bin_size

Documented in check_uniform_bin_size

#' Check that all bins have the same width.
#'
#' @param bins
#'
#' @return TRUE or error message
#'
check_uniform_bin_size <- function(bins) {
  if (diff(range(diff(bins))) < .Machine$double.eps^0.5) TRUE
  else "the bin widths are not all equal or are not ordered"
}
cdcepi/predx documentation built on Dec. 29, 2019, 4:58 p.m.