Yes I know why we always round to the nearest even number if we are in the exact middle (i.e. 2.5 becomes 2) of two numbers. But when I want to evaluate data for some peopl
This mimics the rounding away from zero at .5:
round_2 <- function(x, digits = 0) { x = x + abs(x) * sign(x) * .Machine$double.eps round(x, digits = digits) } round_2(.5 + -2:4)
-2 -1 1 2 3 4 5