try2int {popEpi} | R Documentation |
Attempt coercion to integer
Description
Attempts to convert a numeric object to integer,
but won't if loss of information is imminent (if values after decimal
are not zero for even one value in obj
)
Usage
try2int(obj, tol = .Machine$double.eps^0.5)
Arguments
obj |
a numeric vector |
tol |
tolerance; if each numeric value in |
Value
An 'integer' vector if no information is lost in coercion; else 'numeric' vector.
Author(s)
James Arnold
Source
[Package popEpi version 0.4.12 Index]