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 their blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, 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.

Sponsors

Mango solutions



plotly webpage

dominolab webpage



Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training

datasociety

http://www.eoda.de





ODSC

ODSC

CRC R books series





Six Sigma Online Training









Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)