Facet a choropleth into small multiples (one panel per group or per year) –
the static counterpart to animate_world(), for print and side-by-side
comparison. Builds a world_map() and facets it on facet.
Arguments
- data
A map-ready frame (polygon or sf) containing the
facetcolumn.- fill
The fill column (unquoted).
- facet
The faceting column (unquoted; e.g.
yearorcontinent).- ncol
Number of facet columns (passed to
ggplot2::facet_wrap()).- ...
Passed to
world_map()(e.g.style,projection).
Examples
# \donttest{
snap <- countryatlas::world_snapshot$countries
if (requireNamespace("maps", quietly = TRUE)) {
mapdf <- attach_geometry(snap, geometry = "polygon")
facet_map(mapdf, gdp_per_capita, continent, style = "quantile")
}
# }
