Skip to contents

Round numbers according to statistical principles rather than data science ones i.e. numbers ending in a 5 will always be rounded up, regardless of preceeding number

Usage

round(x, digits = 0)

Arguments

x

a numeric value

digits

integer indicating the number of decimal places. Negative values are allowed; Rounding to a negative number of digits means rounding to a power of ten, so for example round(x, digits = -2) rounds to the nearest hundred.