Mapping World Bank Data

choroplethr provides native support for creating choropleths from data from the World Bank's World Development Indicators (WDI). This functionality is available with the choroplethr_wdi function (?choroplethr_wdi). You can learn more about the World Development Indicators here.

Example: Population

Here is a choropleth of the population of countries in the world, using a continuous scale. See here for more information on code SP.POP.TOTL.

library(choroplethr)
library(WDI) 

choroplethr_wdi(code="SP.POP.TOTL", year=2012, title="2012 Population", num_colors=1)

Example: Life Expectancy

Here is a choropleth of the population of countries in the world. See here for more information on code SP.DYN.LE00.IN.

choroplethr_wdi(code="SP.DYN.LE00.IN", year=2012, title="2012 Life Expectancy")

Example: Per Capita Income

Here is a choropleth of the Per-Capita Income of countries in the world. See here for more information on code NY.GDP.PCAP.CD.

choroplethr_wdi(code="NY.GDP.PCAP.CD", year=2012, title="2012 Per Capita Income")


Try the choroplethr package in your browser

Any scripts or data that you put into this service are public.

choroplethr documentation built on July 9, 2023, 5:35 p.m.