Description Usage Arguments Details Value Examples
View source: R/RoundingFunctions.R
round_preserve_sum
1 | round_preserve_sum(x, digits = 0)
|
x |
a vector of numeric values |
digits |
what to round to, defaults to 0 |
This functions returns a rounded vector of numbers, ensuring that they add to the same total as before rounding.
A character string
1 2 | round_preserve_sum(c(2.2,4.5,8.7))
round_preserve_sum(c(2.2,4.5,8.7), digits = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.