Unlike is.integer
(), which checks the type of argument is `integer`
vector, this function checks whether the value of the argument is an integer
(within a specified tolerance).
is.wholenumber(x, tol = .Machine$double.eps^0.5)
x | a vector |
---|---|
tol | a numeric tolerance |
a logical vector indicating whether `x` has a whole number value
This function is borrowed from the examples for [is.integer()]
is.wholenumber(1)#> [1] TRUE#> [1] TRUEis.wholenumber((1:10)/2)#> [1] FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE