round2: Round a given number, with 5 always rounded up

round2R Documentation

Round a given number, with 5 always rounded up

Description

Given a number and a digit to round to, returns the rounded number, with 5 always rounded upwards.

Usage

round2(x, n)

Arguments

x

the data to be rounded

n

the number of digits to round to

Details

This function differs from round, which rounds 5 "towards the even number". Rounding 5s up leads to bias when positive and negative numbers are expected, but can be desired in some cases.


benmoran11/rubias documentation built on June 10, 2025, 11:27 p.m.