R/utils.R

Defines functions is_integerish

Documented in is_integerish

#' @name is_integerish
#' @title Check for a single integer
#' @description for a single integer
#' @param x input
#' @return TRUE or FALSE
#' @examples
#' \dontrun{is_integerish(1)}
is_integerish = function(x){
    res = is.integer(x) || (is.numeric(x) && all(x == trunc(x)) &&
        !is.na(x))
    res
}

Try the solitude package in your browser

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

solitude documentation built on July 30, 2021, 1:07 a.m.