is.wholenumber: Confirm that the input values are integers.

Description Usage Arguments Details Value See Also

Description

This function validates whether the input values are whole integers or not. It does this by rounding the input values to their nearest whole integer and then evaluating the difference. If the difference is very, very small (the default is .Machine$double.eps^0.5), the numbers will be accepted as whole.

Usage

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

Arguments

x

A vector of numeric values to be tested.

tol

The maximum allowable difference between an input number and the nearest whole number.

Details

All that nonsense is required to avoid floating point comparison errors.

Value

Returns a TRUE if all of the values are integers, FALSE if one or more are not. Drawn directly from the examples in the is.integer documentation.

See Also

is.integer


mmparker/tbdiag documentation built on May 23, 2019, 5:05 a.m.