countryatlas countryatlas hex logo: an orthographic globe choropleth with population spikes rising off the horizon

CRAN status R-CMD-check

Country data from any source, joined on ISO codes and drawn as equal-area maps that state their coverage and source.

🔑 One key for every spelling, in a dozen languages:

library(countryatlas)
d <- data.frame(country = c("Cote d'Ivoire", "Korea, Rep.", "Deutschland", "U.K."))
standardize_country(d, country, add = "iso3c")
#> # A tibble: 4 × 2
#>   country       iso3c
#>   <chr>         <chr>
#> 1 Cote d'Ivoire CIV  
#> 2 Korea, Rep.   KOR  
#> 3 Deutschland   DEU  
#> 4 U.K.          GBR

🗺️ An equal-area map with its coverage and source in the caption:

world_map(attach_geometry(world_snapshot$countries), gdp_per_capita)

World map of GDP per capita in five quantile classes, Equal Earth projection, with a caption giving coverage and source.

🕰️ Memberships and income groups as of any date, row by row:

in_group(c("GBR", "GBR"), "EU", origin = "iso3c", as_of = c(2016, 2021))
#> [1]  TRUE FALSE
classify_countries(data.frame(iso3c = "VNM", year = c(2026, 2027)), "income")
#>   iso3c year              income
#> 1   VNM 2026 Lower middle income
#> 2   VNM 2027 Upper middle income

🚀 Setup

  1. install.packages("countryatlas")
  2. library(countryatlas): the bundled world_snapshot and every map work offline, in Equal Earth.
  3. For the sf backend and every other projection: install.packages(c("sf", "rnaturalearth", "rnaturalearthdata"))
  4. Live data: world_data(2020) from the World Bank, or any provider in country_sources() through fetch_indicator().

📚 Learn more

The Gallery shows every map verb; the articles cover panels, tracing data to its source and honest maps.