Very fast check that numeric vector consists only of whole numbers
is_whole_number(x, tol = sqrt(.Machine$double.eps), na.rm = TRUE)TRUE, FALSE, or NA (see Details)
[numeric(n)] - A numeric vector.
[numeric(1)] - Tolerance.
[logical(1)] - Should NA values be ignored?
Default is TRUE.
is_whole_number() will return NA when these 3 conditions are met:
na.rm is FALSE
x contains at least 1 NA value
x contains only a mix of whole numbers and/or NA values. If any values
are not whole numbers then we can return FALSE even with the presence of
NA values.
If x is not numeric then is_whole_number() always returns FALSE.