my_round: Round to nearest number

Description Usage Arguments Value Author(s) Examples

Description

Round up or down to nearest user specified number.

Usage

1
my_round(x, n, type)

Arguments

x

Vector of numbers to round.

n

Nearest number to which the x-value should be rounded.

type

A string (either 'ceiling' or 'floor') to indicate if the number should be rounded up or down.

Value

Returns a vector of rounded numbers.

Author(s)

Christoffer Rasmussen

Examples

1
2
my_round(24.9, 5, "floor")
my_round(c(24.9, 20.1, 25), 5, "ceiling")

chrras/climateeng documentation built on May 13, 2019, 7:28 p.m.