get_multi_vintage_data: get_multi_vintage_data()

View source: R/get_multi_vintage_data.R

get_multi_vintage_dataR Documentation

get_multi_vintage_data()

Description

Function produces a data.table/dataframe of Census Bureau data for multiple vintages. The function requires an access key issued from the Bureau.

Usage

get_multi_vintage_data(
  dataset,
  vintage_v,
  vars,
  vars_init = c("GEO_ID", "NAME"),
  region = NULL,
  regionin = NULL,
  key = Sys.getenv("CENSUS_KEY")
)

Arguments

dataset

A string that sets the name of the data set of interest (e.g. "acs/acs5")

vintage_v

A numeric vector that sets the vintages of interest.

vars

Can be either a string vector of variable names to be acquired. Also can be a named list of string vectors to separate groups of variables.

vars_init

A string vector of variable names to append to vars, The default is c("GEO_ID", "NAME"). Set it to NULL to disregard it.

region

A string that specifies the geography of the request. See Rcensus::get_geography() for assistance in obtaining these values.

regionin

A string that sets a qualifier for region.

key

A key string issued by the Census Bureau in making data requests.

Details

Get Census Bureau data for a specific dataset, variables, and region in the form of a dataframe for multiple vintages.

Value

A data.table

Author(s)

Rick Dean


deandevl/Rcensus documentation built on Aug. 9, 2022, 8:24 p.m.