round_any: Round to multiple of any number

View source: R/round_any.R

round_anyR Documentation

Round to multiple of any number

Description

Same function from plyr.

Usage

round_any(x, accuracy, f = round)

Arguments

x

Numeric vector of the values to be rounded

accuracy

number to round to

f

Rounding function. One of: floor, ceiling or round

Examples

v <- c(1.22, 2.45, 4.12)
round_any(min(v, na.rm = TRUE), accuracy = 0.5 , f = floor)
round_any(max(v, na.rm = TRUE), accuracy = 0.5 , f = ceiling)

DEQrmichie/heatsourcetools documentation built on Jan. 25, 2025, 2:31 p.m.