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:
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
- Get a Census API Key from here.
- From an R console type:
Now R knows what your census API key is. 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).