is_whole_number | R Documentation |
Because is.integer
checks for the class, not whether the number is an
integer in the mathematical sense.
This code was copy-pasted from the is.integer
docs.
is_whole_number(x, tol = .Machine$double.eps^0.5)
x |
numeric vector |
tol |
tolerance (default: |
logical vector
## Not run:
is_whole_number(c(1, 2, 3))
is.integer(c(1, 2, 3))
is_whole_number(c(1.0, 2.0, 3.0))
is_whole_number(1.2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.