New Tutorial: Make a Census Explorer!

Today I am happy to announce a new tutorial I am running titled Make a Census Explorer with Shiny! It is free and will be held July 28 in San Francisco. In the tutorial we will combine R’s Shiny framework for web development with the census-mapping choroplethr package to create a browser-based census explorer. You can see the final app here. Here is a screenshot:

Screen Shot 2015-07-06 at 10.34.02 AM

Those who took my free email course Learn to Map Census Data might be surprised at the “Year” option in the app.  After all, data.frames like df_state_demographics just contain data from 2013. Where does the extra data come from? Well, choroplethr can connect to the US Census Bureau’s API and get past year’s data as well. To do that do the following

  1. Get a Census API Key from here.
  2. From an R console type:
    api.key.install('<your census API key>')

Now R knows what your census API key is. Next load the choroplethr package by typing library(choroplethr). To get older data type:

  • ?get_state_demographics to get data for states from other years.
  • ?get_county_demographics to get data for counties from other years.
  • ?get_zip_demographics to get data for ZIPs from other years.

Note that the Census API only provides data for the American Community Survey (ACS) from 2010 onwards.

As always, if you create any interesting maps with the package, please tweet them to me (@AriLamstein).

Lung-Chang Chien says March 30, 2016

Hmm… your shiny app is not existing:

the US Census Bureau’s API key also doesn’t work.

Here is the error message after running api.key.install() and submitting ?get_county_demographics:

> ?get_county_demographics
No documentation for ‘get_county_demographics’ in specified packages and libraries:
you could try ‘??get_county_demographics’

    Ari Lamstein says March 30, 2016

    I took the shiny app down because my hosting bill got too expensive. I’m in the process of trying to find cheaper hosting options.

    get_county_demographics is part of the choroplethr package. So try typing:

    ?get_county_demographics should work.

    If you have an interest in this material I recommend taking my free course “Learn to Map Census Data in R”: It walks you through each of these steps and if you have questions you can just click “reply” on the emails to ask me.

Comments are closed