<!--
%\VignetteEngine{knitr}
%\VignetteIndexEntry{h) Mapping World Bank Data}
-->

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](https://datatopics.worldbank.org/world-development-indicators/). 


### Example: Population

Here is a choropleth of the population of countries in the world, using a continuous scale.  See [here](https://data.worldbank.org/indicator/SP.POP.TOTL) for more information on code SP.POP.TOTL.

```{r, hold=TRUE, warning=FALSE, message=FALSE}
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](https://data.worldbank.org/indicator/SP.DYN.LE00.IN) for more information on code SP.DYN.LE00.IN.

```{r, hold=TRUE, warning=FALSE, message=FALSE}
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](https://data.worldbank.org/indicator/NY.GDP.PCAP.CD) for more information on code NY.GDP.PCAP.CD.

```{r, hold=TRUE, warning=FALSE, message=FALSE}
choroplethr_wdi(code="NY.GDP.PCAP.CD", year=2012, title="2012 Per Capita Income")
```