Learn R Programming

lawn (version 0.1.7)

lawn_jenks: Get Jenks breaks

Description

Takes a set of data-Feature's and returns an array of the Jenks Natural breaks for a given property

Usage

lawn_jenks(input, field, numberOfBreaks, lint = FALSE)

Arguments

input
Set of data-Feature's
field
the property in input on which to calculate Jenks natural breaks
numberOfBreaks
Number of classes in which to group the data
lint
(logical) Lint or not. Uses geojsonhint. Takes up increasing time as the object to get linted increases in size, so probably use by default for small objects, but not for large if you know they are good geojson objects. Default: FALSE

Value

An array of the break values (numeric)

References

Jenks Natural breaks http://en.wikipedia.org/wiki/Jenks_natural_breaks_optimization

See Also

Other classification: lawn_nearest, lawn_quantile, lawn_reclass

Examples

Run this code
lawn_jenks(lawn_data$points_average, 'population', 0)
lawn_jenks(lawn_data$points_average, 'population', 1)
lawn_jenks(lawn_data$points_average, 'population', 2)
lawn_jenks(lawn_data$points_average, 'population', 3)
lawn_jenks(lawn_data$points_average, 'population', 4)

Run the code above in your browser using DataLab