Rounding changes the mean of a distribution. rounding_bias()
computes this bias as the mean of the rounded values minus the mean of the
original ones, or, with mean = FALSE, the individual differences.
Arguments
- x
Numeric, or a string coercible to numeric.
- digits
Integer. Number of decimal places to round to.
- rounding
String. The rounding method. Default is
"up". Seevignette("rounding-options").- threshold, symmetric
Passed on to
reround().- mean
Logical. If
TRUE(the default), return the mean bias; otherwise, the individual biases.
Details
All arguments except mean are passed on to reround(). Unlike
there, rounding defaults to "up" and cannot be a compound method
("up_or_down", "up_from_or_down_from", "ceiling_or_floor"), since
those return two rounded values per input and have no single bias.