Description Usage Arguments References Examples
View source: R/round_preserve_sum.R
Round down to the specified number of decimal places
Order numbers by their remainder values
Increment the specified decimal place of values with âkâ largest remainders, where âkâ is the number of values that must be incremented to preserve their rounded sum
1 | round_preserve_sum(x, digits = 4)
|
x |
A numeric vector to apply the algorithm to. This should be a proportion vector where all values equal 1. |
digits |
A numeric. Indicates the number of decimal places to be used. |
https://www.r-bloggers.com/2016/07/round-values-while-preserve-their-rounded-sum-in-r/
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.