Skip to contents

Create world maps for an indicator

Usage

gph_wb_world_map(indicator)

gph_wb_world_hc(indicator)

Arguments

indicator

A list of lists. Each list should contain:

code

A named vector with the name of the indicator and it's World Bank code

operation

An expression that can make operations based on the indicator names

title

Title of the map

file

Name of the file

palette

List with parameters palette for the name of the palette, type for the type of palette and dir for the direction

breaks

Breaks for cutting the data

center

Where is the center of the data (for diverging palettes), -1 otherwise

unit

The unit of the indicator

year

A vector with each year wanted

Examples

if (FALSE) { # interactive()
# Not run: saves the plots on file
indicators <- list(
  list(
    code = c("population" = "EN.POP.DNST"),
    operation = rlang::expr(population),
    title = geotools::gtl_translate_enfr(
      "Population density", "Densité de population"
    ),
    file = "density",
    palette = list(
      palette = "viridis::viridis",
      type = "cont", dir = -1
    ),
    breaks = c(10, 25, 50, 75, 100, 150, 300, 1000),
    center = -1,
    unit = "pp/km²",
    years = c(2019)
  )
)

gph_wb_world_map(indicators)
}