Skip to content

Mapping Gapminder.org Data Sets with the Tidyverse -- Keeping it Simple as Possible.

License

Notifications You must be signed in to change notification settings

Thom-J-H/map_Gap_2_Tidy

Repository files navigation

map_Gap_2_Tidy

Mapping Gapminder.org Data Sets with the Tidyverse -- Keeping it Simple as Possible.

  1. Updating ggplot::map_data('world') :: Making of world_map2.
  2. 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:

fail_bad

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.

Fail Gracefully

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:

fail_better

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.

Greater Interoperability

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:

  1. Updating ggplot::map_data('world') :: Making of world_map2.

  2. Using world_map2 :: Case studies using world_map2.

CC0
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.

Releases

No releases published

Packages

No packages published

Languages