| apply_rounding | R Documentation |
Apply a rounding rule
apply_rounding(x, rule = NA, digits = NA, increment = NA)
x |
A numeric vector. |
rule |
A character string naming the rounding rule. Supported values
are |
digits |
The number of decimal places used when |
increment |
The numeric increment used when
|
A numeric vector containing the rounded values. If rule is
missing or "none", x is returned unchanged.
premiums <- c(101.234, 105.678)
apply_rounding(
premiums,
rule = "nearest_cent"
)
apply_rounding(
premiums,
rule = "nearest_increment",
increment = 5
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.