R/utils.R

Defines functions errorfun is.wholenumber

#' @keywords internal
is.wholenumber <- function(x, tol = .Machine$double.eps^0.5) {
  is.numeric(x) && all(abs(x - round(x)) < tol)
}

#' @keywords internal
errorfun <- function(e) {
  ret <- list(e)
  class(ret) <- "error"
  ret
}

Try the shapr package in your browser

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

shapr documentation built on June 8, 2025, 10:22 a.m.