R/utils.R

Defines functions is.wholenumber

Documented in is.wholenumber

#' Check if a number is integer
#'
#' Check if \code{x} is an integer number, differently from \code{is.integer},
#' which checks the type of the object \code{x}
#'
#' @param x a scalar or a numeric vector
#' @param tol a scalar, indicating the tolerance
#'
#'
#' @note From the help page of function \code{\link[base]{is.integer}}
#'
#' @keywords internal

is.wholenumber <- function(x, tol = .Machine$double.eps^0.5){
    abs(x - round(x)) < tol
}

Try the UPSvarApprox package in your browser

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

UPSvarApprox documentation built on Aug. 27, 2023, 9:06 a.m.