Exploring census and demographic data with R
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I wanted to use R to explore how to access and visualize census data, home value data and school rating data using Indianapolis metro area as an example. My learning objectives here are to learn how to use R to:
- Make choropleth maps at zip code level
- Process data in XML or JSON format that is returned when using API provided by websites (here I chose Zillow and education.com as an example)
The data that I wanted to overlay over the Indianapolis map was median age, median income, median home listing price/value per sq feet, and school rating at the zip code level. I got the census data using US census data API, zip level home demographic data using Zillow demographic API, school rating data using education.com API. (Disclaimer: This is only a one off use of Zillow API and education.com API. I believe I am in compliance with the terms of use of these API for Zillow and education.com. However, if somebody notices any violation of terms of use of these API, please bring it to my attention and I will remove this material). I should also note here that there are several nice interactive tools and widgets on the web that get the same information. My purpose here is just to play with R to extract and visualize this data.
The full R code along with explanation can be found here.
The maps of median age, median household income, median home listing price/value per sq feet and school rating overlaid over Indianapolis map is shown below
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.