countryatlas: Join World Bank Data, Country Codes and Maps on the ISO Spine

A complete toolkit for getting country data onto honest maps. Country names rarely line up across data sources ("US", "U.S.", "United States", "United States of America" are one country, but a naive join treats them as four), so 'countryatlas' makes ISO codes the universal join key, and matches names in many languages. It joins indicators from the World Bank, Our World in Data, the European Union's statistical office and any statistical data and metadata exchange service to bundled Natural Earth borders and the 'countrycode' Rosetta stone, recording each value's source, unit and release, and can pin a World Bank release so a result reproduces; treats country-year panels as first class, with dated income groups, regions and group memberships, lags keyed on the year and aggregates that report their coverage; adds analysis helpers (per-capita, inequality, convergence, distribution dynamics, rates, and spatial statistics with multiple-testing control); and draws a full vocabulary of equal-area maps (classed and continuous choropleths, proportional-symbol, spike, bivariate, ternary, value-by-alpha, cartogram, tile-grid, flow, small-multiple, animated, globe and interactive), and can hand its curated tables to 'ggsql' for database-side rendering. Honesty is treated as a feature rather than a slogan: maps state their coverage and source, draw small states rather than dropping them and describe themselves in alt text, classification methods can be compared side by side, and the distortion each projection introduces can be measured and drawn. Heavy spatial dependencies stay optional, and a bundled offline snapshot lets every example, test and vignette run without the network.

Version: 4.0.0
Depends: R (≥ 4.1.0)
Imports: cachem, cli, countrycode, curl, dplyr, ggplot2, grDevices, jsonlite, lifecycle, memoise, parallel, rlang, stats, tibble, tidyr, tools, utils, WDI
Suggests: biscale, cartogram, cartogramR, classInt, colorspace, comtradr, covr, cshapes, DBI, duckdb, eurostat, gganimate, ggiraph, ggpattern, ggrepel, ggsql, gifski, giscoR, gt, knitr, leaflet, magick, mapgl, mapproj, maps, nanoarrow, plotly, regions, rmapshaper, rmarkdown, rnaturalearth, rnaturalearthdata, scales, sf, shiny (≥ 1.6.0), spdep, stringdist, testthat (≥ 3.2.0), tmap, units, vdiffr, withr
Published: 2026-11-08
DOI: 10.32614/CRAN.package.countryatlas
Author: Youzhi Yu [aut, cre]
Maintainer: Youzhi Yu <yuyouzhi666 at icloud.com>
BugReports: https://github.com/PursuitOfDataScience/countryatlas/issues
License: GPL (≥ 3)
URL: https://pursuitofdatascience.github.io/countryatlas/, https://github.com/PursuitOfDataScience/countryatlas
NeedsCompilation: no
Language: en-GB
Citation: countryatlas citation info
Materials: README, NEWS
CRAN checks: countryatlas results

Documentation:

Reference manual: countryatlas.html , countryatlas.pdf
Vignettes: Beyond the choropleth (source, R code)
countryatlas and ggsql (source, R code)
countryatlas: Joining World Data to Maps on the ISO Spine (source, R code)
Data you can trace: sources, vintages and provenance (source, R code)
Getting started (source, R code)
Honest maps: classification, missingness and distortion (source, R code)
Joining your own data (source, R code)
Panels done right (source, R code)
Modern maps with sf & projections (source, R code)

Downloads:

Package source: countryatlas_4.0.0.tar.gz
Windows binaries: r-devel: countryatlas_3.0.0.zip, r-release: countryatlas_4.0.0.zip, r-oldrel: countryatlas_3.0.0.zip
macOS binaries: r-release (arm64): countryatlas_4.0.0.tgz, r-oldrel (arm64): countryatlas_4.0.0.tgz, r-release (x86_64): countryatlas_3.0.0.tgz, r-oldrel (x86_64): countryatlas_3.0.0.tgz
Old sources: countryatlas archive

Linking:

Please use the canonical form https://CRAN.R-project.org/package=countryatlas to link to this page.