Mapping Gapminder.org Data Sets with the Tidyverse -- Keeping it Simple as Possible.
- Updating ggplot::map_data('world') :: Making of
world_map2
. - Using world_map2 :: Case studies using
world_map2
.
If we want to do simple Choropleth maps in the Tidyverse, and so likely using ggplot2::map_data("world")
, we might get a result like this when our mapping data and Global Studies data have name mismatches or missing information:
The white spaces for Afghanistan and various nations in Africa and Southeast Asia are unnecessarily confusing. Missing data does not mean these nations were replaced by ocean or otherwise ceased to exist.
Instead, we want to fail gracefully. NA cases should be displayed: knowing that we have no data for certain nations is both important and useful. The following would better serve:
Our updated version, world_map2
, both allows for graceful failure when data is missing, and contains the standard ISO country codes: Alpha-2 code, Alpha-3 code, and Numeric code.
A markdown document Using world_map2 offers examples in Tidying and mapping Global Studies data sets with world_map2. The same document is also archived here.
So we no longer need to rely on name matching if our statistical data uses the ISO country codes as identifiers. The markdown document explaining the making of world_map2
is archived here at GitHub and published at RPubs. The updated data set is available here.
Thank you for reading! Please feel free to improve world_map2.
TJ Haslam
2021-08-13
Reports @ RPubs:
-
Updating ggplot::map_data('world') :: Making of
world_map2
. -
Using world_map2 :: Case studies using
world_map2
.
To the extent possible under law,
Thomas Joseph Haslam
has waived all copyright and related or neighboring rights to
Mapping Global Studies Data with the Tidyverse.
This work is published from:
United States.