roundCut: Round numbers in interval

Description Usage Arguments Value See Also Examples

Description

Formats an interval of form (5.234,11.783] to something like (5.2,11.8]. Used for formatting only, mainly with binning functions like depthbin. Intervals can be opened or closed with ( and [ respectively and are maintained as such when formatted. Useful for prettifying graphs and reports.

Usage

1
roundCut(x, r = 1)

Arguments

x

character vector of bins to format

r

number, 0 to 10 (or higher I suppose) indicating how many decimals to display

Value

formatted character vector with length of input vector.

See Also

depthbin

Examples

1
2
x1 <- cut(quantile(rnorm(100)), breaks=4)
roundCut(x1, 1)

brooksandrew/Rsenal documentation built on May 13, 2019, 7:50 a.m.