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

roundn

Rounds up in the usual manner


Description

The standard round function in R rounds x.5 to the nearest even integer. This is odd behavior that is corrected in roundn

Usage

roundn(x, digits = 0)

Arguments

x

Number to be rounded

digits

Sets the number of decimals in rounding.

Value

n

A number

Author(s)

Rampal S. Etienne

Examples

round(2.5)
roundn(2.5)
round(3.5)
roundn(3.5)
round(2.65,digits = 1)
roundn(2.65,digits = 1)
round(2.75,digits = 1)
roundn(2.75,digits = 1)

DDD

Diversity-Dependent Diversification

v4.4.1
GPL-3
Authors
Rampal S. Etienne & Bart Haegeman
Initial release
2021-01-14

We don't support your browser anymore

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