A world map of one indicator for one year, in classes, with a light-to-dark ramp of one hue that
also reads in black and white. The legend, under the map, follows the current language
(see geotools::gtl_opt_set_i18n()). The map has no title; the caption gives the source.
Usage
gph_map_world_indicator(
indicator,
year,
breaks = NULL,
unit = NULL,
palette = "Blues",
theme = ggplot2::theme_void()
)Arguments
- indicator
A World Bank indicator code (
"SP.DYN.TFRT.IN") or a column of the UN World Population Prospects 2024 indicators ("TFR","PopDensity", seegeodata::gdt_wpp_indicators()). World Bank codes are told apart by their dots.- year
The year
- breaks
The limits between the classes: five classes of about the same size when
NULL- unit
The unit, written above the legend
- palette
A sequential ColorBrewer palette: "Blues", "Greens", "Greys", "Oranges", "Purples", "Reds"...
- theme
A ggplot2 theme
Examples
if (FALSE) { # interactive()
gph_map_world_indicator(
"TFR", 2023,
breaks = c(1.5, 2.1, 3, 4.5),
unit = geotools::gtl_translate_enfr("children per woman", "enfants par femme", "Kinder pro Frau")
)
gph_map_world_indicator("SP.DYN.IMRT.IN", 2022, unit = "‰", palette = "Reds")
}
