knitr::opts_chunk$set(echo = TRUE) library(psrccensus) library(dplyr)
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')
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.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.