Non-overlapping proportional circles sized by weight, positioned to stay
as close as possible to each country's true location – arguably the most
legible cartogram variant, since a microstate's circle is exactly as
visible as a giant country's. A first-class verb for
cartogram_map()(type = "dorling") that surfaces the Dorling-specific
tuning knobs.
Usage
dorling_map(
data,
weight,
fill = NULL,
k = 5,
itermax = 1000,
projection = "equal_earth",
footnote = "auto"
)Arguments
- data
An
sfmap-ready frame.- weight
The column controlling circle size (unquoted).
- fill
Optional fill column (unquoted); defaults to
weight.- k
Share of the bounding box filled by the largest circle (default
5; passed tocartogram::cartogram_dorling()).- itermax
Maximum iterations of the circle-repulsion algorithm (default
1000; raise it if circles still overlap in the result).- projection
Projection; an equal-area CRS is recommended. See
world_map()for the projections available.- footnote
The caption, as in
world_map():"auto"(default) states the coverage and source, a string is used as given,FALSEadds nothing.
Backend
The sf backend only: the cartogram package places its circles from sf
geometry, in projection (Equal Earth by default).
Examples
# \donttest{
if (requireNamespace("sf", quietly = TRUE) &&
requireNamespace("rnaturalearth", quietly = TRUE) &&
requireNamespace("cartogram", quietly = TRUE)) {
attach_geometry(countryatlas::world_snapshot$countries, geometry = "sf") |>
dorling_map(population)
}
# }
