getMaxNDecimals | R Documentation |
The function getNDecimals
) extracts the number
of decimals in a specific variable.
getMaxNDecimals(x, ...)
x |
Numeric vector. |
... |
Any parameters for the |
Integer with maximum number of decimals in a character vector.
Laure Cougnaud
Other decimals:
formatPercentage()
,
getMaxNDecimalsData()
,
getNDecimals()
,
getNDecimalsData()
x <- c(0.99, 5.679, 50.45, 1450)
# extract max number of decimals based on data:
getMaxNDecimals(x, useRule = FALSE, useData = TRUE)
# extract max number of decimals based on pre-defined rule:
getMaxNDecimals(x, useRule = TRUE, useData = FALSE)
# extract max number of decimals based on both rules
# minimum of both is used (by default)
getMaxNDecimals(x, useRule = TRUE, useData = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.