What is a choropleth? When should I use one?

A choropleth is a map which

  1. Shows geographic boundaries.
  2. Colors those regions based on some metric.

The most widely recognized choropleth is probably the US Presidential Election Map, which colors states based on which presidential candidate the state voted for. To create that map in choroplethr simply type:

    library(choroplethr)
    data(choroplethr)
    choroplethr(df_president, "state", title="Results from the 2012 US Presidential Election")

plot of chunk unnamed-chunk-1

If you are dealing with a dataset that maps geographic regions to values, you should consider visualizing it with a choropleth. Choropleth maps help people understand geographic patterns in data. For example, in the above map it is clear that all states on the west coast voted for Obama. That is less clear when viewing the dataset as a list of (region, value) pairs:

df_president
##    region  value
## 3      AL Romney
## 4      AK Romney
## 5      AZ Romney
## 6      AR Romney
## 7      CA  Obama
## 8      CO  Obama
## 9      CT  Obama
## 10     DE  Obama
## 11     DC  Obama
## 12     FL  Obama
## 13     GA Romney
## 14     HI  Obama
## 15     ID Romney
## 16     IL  Obama
## 17     IN Romney
## 18     IA  Obama
## 19     KS Romney
## 20     KY Romney
## 21     LA Romney
## 22     ME  Obama
## 23     MD  Obama
## 24     MA  Obama
## 25     MI  Obama
## 26     MN  Obama
## 27     MS Romney
## 28     MO Romney
## 29     MT Romney
## 30     NE Romney
## 31     NV  Obama
## 32     NH  Obama
## 33     NJ  Obama
## 34     NM  Obama
## 35     NY  Obama
## 36     NC Romney
## 37     ND Romney
## 38     OH  Obama
## 39     OK Romney
## 40     OR  Obama
## 41     PA  Obama
## 42     RI  Obama
## 43     SC Romney
## 44     SD Romney
## 45     TN Romney
## 46     TX Romney
## 47     UT Romney
## 48     VT  Obama
## 49     VA  Obama
## 50     WA  Obama
## 51     WV Romney
## 52     WI  Obama
## 53     WY Romney