Learn R Programming

emon (version 1.3)

is.wholenumber: To check whether an argument is an integer

Description

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

Usage

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

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

Run the code above in your browser using DataLab