Choropleth Maps Revisited

Since my original post on choropleth maps a little over a month ago I have been thinking about ways to display all of the data in Table 1 (i.e. Reed College enrollment by state from 2007-2013) in a single choropleth map. Yesterday, I read about a relatively new R package called rMaps. According to the developer Ramnath Vaidyanathan’s github page, “rMaps makes it easy to create, customize and share interactive maps from R, with a few lines of code. It supports several javascript based mapping libraries like Leaflet, DataMaps and Crosslet, with many more to be added.”

Today, I was able to use rMaps to make two dynamic choropleth maps. The first map below is designed to draw attention to the states from which no Reed students matriculated each year from 2007-2013. Initially, the map shows the 2007 data and completely shades in any state that did not have a matriculating Reed College student in 2007. Pressing the play button in the upper left-hand corner will run the map and will display the data for subsequent years.

The second map represents the number of matriculants from each state with a color gradient that is displayed in a legend below the map. To replay either of the maps you will need to refresh your browser.

These maps are works in progress and are far from perfect. This post is intended to demonstrate the functionality of the rMaps package and how it enables users to create dynamic choropleth maps quickly (I downloaded the package at 10 am this morning). There are a few bugs in the above maps (like the text “2014” showing up at the end of the animation in the first map despite not being represented in the data). Bugs in my code withstanding, I think this proof-of-concept is a powerful demonstration of the rapidly expanding capabilities of R.

This entry was posted in Data Visualization, Quantitative analysis and tagged , . Bookmark the permalink.