Calculate breaks to discretize a numeric vector, using different methods

get_breaks(x, n = 5, method = break_methods())

Arguments

x

a numeric vector

n

integer indicating the number of intervals/bins desired

method

a character of length 1, indicating the method to use. Possible values are c("jenks", "isowidth", "quantile")

Value

a numeric vector of length <= n + 1.

Examples

get_breaks(1:100, 5)
#> [1]   1  20  40  60  80 100