Learn R Programming

tidycensus (version 1.2.1)

load_variables: Load variables from a decennial Census or American Community Survey dataset to search in R

Description

Load variables from a decennial Census or American Community Survey dataset to search in R

Usage

load_variables(year, dataset, cache = FALSE)

Arguments

year

The year for which you are requesting variables. Either the year or endyear of the decennial Census or ACS sample. 5-year ACS data is available from 2009 through 2018. 1-year ACS data is available from 2005 through 2019.

dataset

One of "sf1", "sf2", "sf3", "sf4", "pl", "as", "gu", "mp", "vi", "acs1", "acs3", "acs5", "acs1/profile", "acs3/profile, "acs5/profile", "acs1/subject", "acs3/subject", or "acs5/subject".

cache

Whether you would like to cache the dataset for future access, or load the dataset from an existing cache. Defaults to FALSE.

Value

A tibble of variables from the requested dataset.

Examples

Run this code
# NOT RUN {
v15 <- load_variables(2015, "acs5", cache = TRUE)
View(v15)
# }

Run the code above in your browser using DataLab