Skip to contents

countryatlas exists to kill one recurring source of pain: country names never line up across data sources. The package makes ISO codes the universal join key and hands you a ready-to-map tibble that stitches together map geometry (ggplot2::map_data() or Natural Earth sf), World Bank indicators (WDI::WDI()) and the countrycode::countrycode() crosswalk.

Details

The happy path stays one call: world_data(). Everything else is opt-in.

Database rendering (ggsql)

as_ggsql_source(), world_query().

Performance & caching

clear_wdi_cache().

Options

Three options change the package's behaviour. All are unset by default.

countryatlas.cache_dir

Where the persistent World Bank cache lives. Defaults to tools::R_user_dir("countryatlas", "cache"); set it to "" for session-only caching. See clear_wdi_cache().

countryatlas.workers

How many processes fetch indicators in parallel (only when the cache is on disk – a memory-only memo cannot survive a fork). Defaults to one fewer than the available cores, and to 2 under R CMD check, per CRAN policy. Must be a single finite number; values below one are clamped to one.

countryatlas.gdp_compat

Set to TRUE to restore the gdp_per_capita_2015 column that world_data() emitted in 1.0.0. It is a one-cycle deprecation shim and off by default.

Author

Maintainer: Youzhi Yu yuyouzhi666@icloud.com