Skip to contents

Returns a number rounded to the nearest specified multiple.

Usage

RoundTo(x, multiple = 1, FUN = round)

Arguments

x

is a vector of value in decibel (dB)

multiple

numeric. The multiple to which the number is to be rounded. Default is 1.

FUN

the rounding function as character or as expression. Can be one out of trunc, ceiling, round (default) or floor.

Value

value or vector of values rounded

Author

Andri Signorell andri@signorell.net

Examples

#data("P1FA")

RoundTo(x = P1FA$LAeq, multiple = 0.5)[1:10]
#>  [1] 58.0 52.0 47.0 47.0 47.0 47.5 48.0 47.0 48.5 51.0