Takes an object produced by choropleth_sf()
, and creates
the correspoding choropleth map.
choropleth_ggplot2(
sf_object,
value = output,
n = 7,
dig.lab = 2,
legend_title = "Class",
option = "D",
direction = 1
)
object of class sf
column to shade the polygons
number of clusters (default is 7)
number of digits in legend (default is 2)
title of legend
a character string indicating the colormap option to use. Four options are available: "magma" (or "A"), "inferno" (or "B"), "plasma" (or "C"), "viridis" (or "D", the default option) and "cividis" (or "E").
Sets the order of colors in the scale. If 1
,
the default, colors are ordered from darkest to lightest. If -1
,
the order of colors is reversed.
ggplot map
test <- points_to_polygon(nl_postcode2, insurance, sum(amount, na.rm = TRUE))
#> 80 points fall not within a polygon.
choropleth_ggplot2(test)