February 1, 2019

Better ways to present country-level data on a world map: equal-area cartograms

I’m just working on a report for the IFRC. There is lots of data from 190 different Red Cross Red Crescent National Societies around the world1.

Cutting to the chase:

.. that is our improved map-like solution, and I’ll show the code further down. What it is really missing is a nice stylised outline of continents in the background.

Why do I claim this is a better viz? Sometimes we’ve been using ordinary choropleths:

(In this case we are looking at the percentage of women on the governing board.) These maps look nice but they are really poor at presenting actual information IMHO. You can’t even tell which continent is doing better, and did you spot that Ghana has a pretty poor percentage? Did you spot the high scores for Georgia and Latvia and Moldova?

Equal-area aka equal-size cartograms are better, but I only found examples with ISO3 codes, which are really user-unfriendly. So I got my son to retype rbrath’s map into a spreadsheet and R does the rest.

You need this csv file which just gives you the iso and country names in terms of x and y coordinates.

Then you need a data.frame called say xx which has a column called iso3 and your data. Merge them together and there you go.

xx %>% dplyr::merge(maps,by = "iso3",all.y=F) %>% 
  ggplot(aes(x,y,fill=fem_GovBoard,label=name %>% str_wrap(8)))+geom_tile()+geom_text(hjust=.51,lineheight=.7,color="black")+
  scale_fill_gradient(low = "red",high="white")+
  theme(panel.background = element_rect(fill="#445566"),panel.grid = element_line(color="#445566"))

  1. FDRS, Federation-wide Databank and Reporting System

r nerdvana

Previous post
A starter kit for reproducible research with R This accompanies my draft short article for the UKES Bulletin: A reproducible workflow for evaluation reports. Here are just two files which
Next post
Answering the “why” question: piecing together multiple pieces of causal information ((This is an abstract I just submitted to the 2019 DGeval conference in Bonn.)) We evaluators often ask questions about what causes

This blog by Steve Powell is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, syndicated on r-bloggers and powered by Blot.
Privacy Policy