ch.round_any: New Rounding Function

View source: R/chUtils.r

ch.round_anyR Documentation

New Rounding Function

Description

This function rounds numbers to a specified precision to in a particular direction.

Usage

ch.round_any(x, accuracy, f = ceiling, center = TRUE)

Arguments

x

a vector of numbers.

accuracy

the accuracy of the rounding.

f

the function for rounding: floor, ceiling, round. DEFAULT = ceiling

center

a boolean specifying whether to center the bin label in the ceiling and floor cases. DEFAULT = TRUE

Examples

ch.round_any (x, .1, ceiling)

ccpluncw/ccpl_R_chutils documentation built on Feb. 28, 2024, 1:17 a.m.