Description Usage Arguments Value Source Examples
Rounds a vector of numbers while preserving the sum of them.
1 | round_preserve_sum(x, digits = 0)
|
x |
A numeric vector. |
digits |
The number of digits to take in account in the rounding process. |
round_preserve_sum
returns y
with round vector.
https://www.r-bloggers.com/round-values-while-preserve-their-rounded-sum-in-r/ and http://stackoverflow.com/questions/32544646/round-vector-of-numerics-to-integer-while-preserving-their-sum
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.