Draws a choropleth of data at level. Requires sf, ggplot2, and
geometry attached with attach_geometry_geoscale().
Usage
geoscale_plot(
x,
data = NULL,
level = NULL,
fill = NULL,
palette = NULL,
title = NULL,
subtitle = NULL,
fill_label = fill,
label = FALSE,
...
)Arguments
- x
A
Geoscalewith geometry attached.- data
Optional
data.framewith a code column namedleveland the column named byfill. WhenNULL, region outlines are drawn.- level
Level to draw. Defaults to the atom level.
- fill
Name of the value column in
datato colour by.- palette
Viridis palette option (
"A".."H") for the fill scale.NULL(default) leaves ggplot2's own scale in place.- title, subtitle
Plot titles.
NULLfor none.- fill_label
Legend title. Defaults to
fill; passNULLto drop it.- label
Draw region labels.
TRUEuses the display names declared by the geoscale's@meta$labelscolumn when there is one, otherwise the region codes.- ...
Passed to
ggplot2::geom_sf().