Skip to contents

chop_evenly() chops x into intervals intervals of equal width.

Usage

chop_evenly(x, intervals, ...)

brk_evenly(intervals)

tab_evenly(x, intervals, ...)

Arguments

x

A vector.

intervals

Integer: number of intervals to create.

...

Passed to chop().

Value

chop_* functions return a factor of the same length as x.

brk_* functions return a function to create breaks.

tab_* functions return a contingency table().

See also

Examples

chop_evenly(0:10, 5)
#>  [1] [0, 2)  [0, 2)  [2, 4)  [2, 4)  [4, 6)  [4, 6)  [6, 8)  [6, 8)  [8, 10]
#> [10] [8, 10] [8, 10]
#> Levels: [0, 2) [2, 4) [4, 6) [6, 8) [8, 10]