knitr::opts_chunk$set(echo = TRUE)
library(psrccensus)
library(dplyr)

Get ACS data

Suppose you wish to tabulate ACS one-year 2019 data for estimates of total people by race and ethnicity, as provided in table B03002 by PSRC counties. You would use the following function call:

get_acs_recs(geography = 'county',
             table.names = 'B03002',
             years = 2019,
             acs.type = 'acs1')

Default and custom arguments

By default, without specifying any counties, the jurisdictions returned will be King, Kitsap, Pierce, and Snohomish Counties. Use ?get_acs_recs() for other default values implemented in this function.

To retrieve non-PSRC counties or a subset of the default counties, use the counties argument and provide a vector of counties (e.g. counties = c("King", "Thurston")). Do not use the fips argument as that is reserved for MSA or place geographies.

Get Census data

The get_decennial_recs() to generate Decennial Census tables operates similarly to the get_acs_recs(). If you wanted to retrieve housing units and total population by MSA, you would call the following:

get_decennial_recs(geography = 'msa',
                   table_codes = c("H001", "P001"),
                   years = c(2010),
                   fips = c('42660', "28420"))

Note: the table names are padded with 0s, so you call "H001" as opposed to "H1" as you would in Elmer. Only SF1 tables are currently implemented.



psrc/psrccensus documentation built on June 1, 2025, 1:06 p.m.