| plot_brmap | R Documentation |
Creates a 'ggplot' using [ggplot2::geom_sf()]. The returned object can be extended with any regular ggplot2 layer, scale or label.
plot_brmap(
map,
data = NULL,
by = NULL,
fill_by = NULL,
theme = theme_brmap(),
border_colour = "grey30",
border_linewidth = 0.15,
fill = "white",
data_to_join = NULL,
join_by = NULL,
var = NULL
)
map |
An 'sf' or legacy 'Spatial' polygon object. |
data |
Optional data frame to join before plotting. |
by |
Join specification accepted by [dplyr::left_join()]. |
fill_by |
Optional single column name mapped to polygon fill. |
theme |
A complete or partial ggplot2 theme. |
border_colour |
Polygon border colour. |
border_linewidth |
Polygon border width. |
fill |
Constant fill used when 'fill_by' is 'NULL'. |
data_to_join, join_by, var |
Deprecated aliases for 'data', 'by' and 'fill_by'. |
A 'ggplot' object.
[get_brmap()], [join_brmap()]
data("pop2017")
south <- get_brmap(
"municipality", year = 2023, filters = list(region = 4)
)
plot_brmap(
south,
data = pop2017,
by = c("municipality_code" = "mun"),
fill_by = "pop2017"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.