Skill Level: Intermediate
Duration: 3-4 hours
This course will teach you how to visualize data from the US Census Bureau’s American Community Survey (ACS) using the R package Choroplethr.
The introduction will teach you the necessary prerequisites: how to install R, RStudio and the choroplethr package. The module Choroplethr Basics will teach you how to map data in R using the choroplethr package. You will learn how to map a sample dataset, as well as how to customize the map.
In Variables and Vintages you will learn how to access the Census Bureau’s API, map data from other years and explore more demographic statistics. In the module Data Details you will learn the details of the data you’ve been mapping. This includes learning about the data source (the American Community Survey), how it differs from the Decennial Census, and the amount of data which is available.
Finally, in Learning More you will learn resources to continue learning about both the ACS and Choroplethr.
After completing this course, you will be able to:
✓ Create maps of contemporary and historic demographic statistics in R
✓ Conduct exploratory data analysis using maps
✓ Understand what the American Community Survey is, and how it differs from the Decennial Census
✓ Access data via the Census Bureau’s API
Data Analysts and Data Scientists who wish to learn more about R, Census Data or the American Community Survey. Prior knowledge of R is not required, but prior experience with computer programming will be helpful.
Ari Lamstein is an R Trainer and Consultant who is located in San Francisco, California. He is the author of several R packages, including choroplethr.
This module will teach you the necessary prerequisites: how to install R, RStudio and the choroplethr package.
You will need to install the R programming language in order to complete this course. R is completely free.
To install it, first visit r-project.org. Then follow the instructions in the video.
Many people find that using a program called RStudio makes it easier to program in R.
RStudio is completely free to use. To install it, visit RStudio.com and follow the directions in the video.
To use choroplethr, you need to install two packages. Go the RStudio “console” pane and type the following:
install.packages("choroplethr")
install.packages("choroplethrMaps")
This module will teach you how to map data in R using the choroplethr package. You will learn how to map a sample dataset, as well as how to customize the map.
Load the packages by typing the following from the R Console:
library(choroplethr)
library(choroplethrMaps)
Verify that the packages are loaded by looking at the “Packages” window. Choroplethr and ChoroplethrMaps should have a checkmark next to them.
To view the example data, type the following:
library(choroplethr)
library(choroplethrMaps)
data(df_pop_state)
# show the data in the console
df_pop_state
# load the data in the Viewer
View(df_pop_state)
To create a sample map using choroplethr, type the following:
library(choroplethr)
library(choroplethrMaps)
data(df_pop_state)
state_choropleth(df_pop_state)
NOTE: Due to changes in Google's API, you need to do the following before running the example below.
library(ggmap)
register_google("< your api key >")
install.packages("mapproj")
Due to recent changes in the Google Maps API, the instructions for the last example require minor changes to run. Please download the file below to see the new code.
In this module you will learn how to access the Census Bureau’s API, map data from other years and explore more demographic statistics.
In this module you will learn the details of the data you’ve been mapping. This includes learning about the data source (the American Community Survey), how it differs from the Decennial Census, and the amount of data which is available.
Each year the ACS releases data for 1- and 5-year spans. This page from the Census Bureau provides guidance on when to use each span. The choroplethr function ?get_state_demographics has a parameter called span that lets you choose which estimate to get.
In this module you will learn resources to continue learning about both the ACS and Choroplethr.
To learn more about the American Community Survey visit the official American Community Survey site.
To learn more about choroplethr visit choroplethr.com.
Share your accomplishment on your social media by downloading this certificate or badge!
I just finished the Mapping Census Bureau Data in R with Choroplethr Course with Census Academy! Be sure to check out their free resources!
#CensusBureau #CensusData #CensusAcademy #AmericanCommunitySurvey #ACS #Choroplethr