R/utils.r

Defines functions assert_is_number

assert_is_number <- function(x) {
  is_number <- length(x) == 1L & grepl("[[:digit:]]+", x)
  if (!is_number) {
    stop("value is not a number or string of numbers", call. = FALSE)
  }
}
zamorarr/nhlapi documentation built on May 14, 2019, 2:02 a.m.