Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Round

Round Half Away from Zero


Description

This is an ordinary rounding function, so called round half away from zero

Usage

Round(x, n = 0)

Arguments

x

numeric to be rounded

n

indicating decimal digits

Details

The function round in R base rounds to the even number, i.e. round(0.5) is 0 not 1. If you want rounding 0.5 be 1, you can use this Round function. This function is for the consistency with other software like MS-Excel, SAS.

Value

ordinarily rounded value

Author(s)

Kyun-Seop Bae <k@acr.kr>

References

See wikipedia subject "Rounding"

Examples

(x = 1:10 - 0.5)
Round(x)
round(x) # compare with the above

pkr

Pharmacokinetics in R

v0.1.2
GPL-3
Authors
Kyun-Seop Bae [aut], Jee Eun Lee [aut]
Initial release
2018-06-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.