Skip to contents

This function ensures that rounding in R matches rounding in Insight Maker. R base's round() rounds .5 to 0, whereas round_IM() rounds .5 to 1.

Usage

round_IM(x, digits = 0)

Arguments

x

Value

digits

Number of digits; optional, defaults to 0

Value

Rounded value

Details

Source: https://stackoverflow.com/questions/12688717/round-up-from-5/12688836#12688836

Examples

round_IM(.5)
#> [1] 1