To check whether an argument is an integer

Share:

Description

Used in error checking to ascertain whether a function argument is an integer.

Usage

1
is.wholenumber(x, tol = .Machine$double.eps^0.5)

Arguments

x

Number to be checked.

tol

If x is closer to an integer than this, then it passes.

Value

Vector of logical values if the corresponding input values is an integer or not.

References

is.wholenumber is taken from the is.integer help file.

Examples

1
is.wholenumber( seq(1, 5, by = 0.5) ) #-->  TRUE FALSE TRUE ...

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.