R/testInt.R

Defines functions testInt

Documented in testInt

#'
#' Verify that x is an integer value
#'
#'@param x integer value to check: Must be numeric
#'@return TRUE if integer, FALSE if not
#'@export
testInt <- function(x) {
    if (!is.numeric(x)) {
        stop("Argument must be numeric")
    }
    t <- all.equal(x, as.integer(x))
    if (t == TRUE) {
        return(TRUE)
    } else {
        return(FALSE)
    }
}
dco61/isteahMAT104 documentation built on Jan. 2, 2022, 2:24 a.m.