View source: R/utility_functions.R
try2int | R Documentation |
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
)
try2int(obj, tol = .Machine$double.eps^0.5)
obj |
a numeric vector |
tol |
tolerance; if each numeric value in |
An integer
vector if no information is lost in coercion; else numeric
vector.
James Arnold
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.