jenks | R Documentation |
Given a numeric vector, this returns a factor of those values cut
into n
number of breaks using the Jenks/Fisher algorithms. The algorithm(s) sets breaks in a way that highlights very high or very low values well. It's good to use for choropleths that need to convey imbalances or inequities.
jenks(x, n = 5, true_jenks = FALSE, labels = NULL, ...)
x |
A numeric vector to cut |
n |
Number of bins, Default: 5 |
true_jenks |
Logical: should a "true" Jenks algorithm be used? If false, uses the faster Fisher-Jenks algorithm. See |
labels |
A string vector to be used as bin labels, Default: NULL |
... |
Additional arguments passed on to |
A factor of the same length as x
classInt::classIntervals
set.seed(123)
values <- rexp(30, 0.8)
jenks(values, n = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.