Easy data maps with R: the choroplethr package

January 21, 2014
By

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

Choropleth maps are a popular way of representing spatial or geographic data, where a statistic of interest (say, income, voting results or crime rate) are color-coded by region. R includes all of the necessary tools for creating choropleth maps, but Trulia's Ari Lamstein has made the process even easier with the new choroplethr package now available on github. With couple of lines of code, you can easily convert a data frame of values coded by country, state, county or zip code into a choropleth like this:

ACS-zip-income

The chart above shows the US zip codes with the highest per-capita incomes, based on data from the US Census Bureau's American Community Survey. The choroplethr package also includes an interface to ACS data, so if you know the data code you're looking for, you can create a choropleth of your favourite US demographic statistic with just a single line of code, like this:

choroplethr_acs(tableId="B19301", lod="zip")

You can read more information about the capabilities of the choroplethr package at the Trulia Tech+Design Blog. Many thanks to Trulia and Ari Lamstein for supporting the development of this useful package!

Trulia Tech+Design Blog: The choroplethr package for R

To leave a comment for the author, please follow the link and comment on his blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.