is.wholenumber: Function to check if a number is a whole number

Description Usage Arguments Value Authors References Examples

View source: R/postProcess.R

Description

Function to check if a number is whole, accounting for a rounding error.

Usage

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

Arguments

x

The number to be checked.

tol

Tolerance level.

Value

The default method for 'is.wholenumber' returns 'TRUE' if the number provided is a whole number.

Authors

David Hastie, Department of Epidemiology and Biostatistics, Imperial College London, UK

Silvia Liverani, Department of Epidemiology and Biostatistics, Imperial College London and MRC Biostatistics Unit, Cambridge, UK

Maintainer: Silvia Liverani <[email protected]>

References

Silvia Liverani, David I. Hastie, Lamiae Azizi, Michail Papathomas, Sylvia Richardson (2015). PReMiuM: An R Package for Profile Regression Mixture Models Using Dirichlet Processes. Journal of Statistical Software, 64(7), 1-30. URL http://www.jstatsoft.org/v64/i07/.

Examples

1
2
is.wholenumber(4) # TRUE
is.wholenumber(3.4) # FALSE

PReMiuM documentation built on Sept. 26, 2018, 5:04 p.m.