Download and view a table of data from the ACS
Variables in the decennial Census and American Community Survey are organized into tables, within which they share a common prefix. Commonly, analysts will want to work with all variables in a given table, as these variables might represent different aspects of a common characteristic (such as race or income levels). To request data for an entire table in tidycensus, users can specify a table
argument with the table prefix, and optionally cache a dataset of table codes to speed up table searching in future requests. In this exercise, you'll acquire a table of variables representing different income bands, then filter out the denominator rows.
This exercise is part of the course
Analyzing US Census Data in R
Exercise instructions
- For counties in Washington, download table
"B19001"
from the ACS using thetable
argument. - Check the variables you've acquired using the
head()
function.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
library(tidycensus)
library(tidyverse)
# Download table "B19001"
wa_income <- ___(___ = "county",
state = "WA",
table = ___)
# Check out the first few rows of wa_income
___(wa_income)