build_api_variable: Vectorized Creation of Census ACS Variables

View source: R/build_api_variable.R

build_api_variableR Documentation

Vectorized Creation of Census ACS Variables

Description

All detail group variables have the format "B000OO*_000E", where the "B" and "E" are literal and the "*" is a race code.

Usage

build_api_variable(
  group_code,
  item_number,
  race_code = "",
  separator = "_",
  suffix = "E"
)

Arguments

group_code

the group code, like "B18101"

item_number

some integer between 0 and 999

race_code

optional, either an empty string or one of [A..I]

separator

optional, usually "_" for ACS variables.

suffix

optional, usually "E" for ACS variables, but sometimes "N" for decennial data.

Value

a vector of strings, each of which is a variable name

Examples

groups <- c("B19013", "B18101", "B18101")
races <- c("", "", "I")
numbers <- 1
build_api_variable(groups, numbers, races)

higherX4Racine/hercacstables documentation built on Jan. 15, 2025, 9:58 p.m.