R/utils.r

Defines functions is_count

is_count <- function(x) {
  if (length(x) != 1 || !is.numeric(x) || x <= 0) {
    return(FALSE)
  }
  is.integer(x) || (is.numeric(x) && all(x == as.integer(x)))
}
mstrimas/metacapa documentation built on Dec. 3, 2019, 3:16 p.m.