Description Usage Arguments Value Warning Examples
This function is a wrapper around the 'dplyr' 'mutate()' function that generates Jenks breaks using the 'classIntervals' package.
See classIntervals
for more details on methods.
1 | mutate_jenks_brks(input, variable, ...)
|
input |
a 'data.frame' or 'spatial' object |
variable |
name (using standard evaluation) a continuous variable either 'integer' or 'numeric' to apply Jenks breaks |
... |
arguments used in 'classIntervals' specific to 'style = "jenks"' |
returns the 'input' object with a new 'factor' columns named as 'variable_brks' that contains Jenks breaks and corresponding labels for each 'factor' level
The Jenks breaks do not like missing values and will give a warning message when the variable of interest contains missing values!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #Apply Jenks breaks on the Solar Radiation column frmo the airqualtiy dataset
airquality %>% mutate_jenks_brks(Solar.R)
## Not run:
# Ebola Cause of Death joined to Chiefdom Shapefiles
# create Jenks breaks for deaths with 6 breaks
evd_shp <- evd_shp %>% mutate_jenks_brks(deaths, n = 6)
p_evd_deaths <- ggplot(evd_shp) + geom_sf(aes(fill=deaths_brks)) +
scale_fill_brewer(type = "seq", palette = 9, name = "Deaths") +
theme_void()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.