census_api_url: Create an API call to send to api.census.gov

View source: R/census_api_url.R

census_api_urlR Documentation

Create an API call to send to api.census.gov

Description

Create an API call to send to api.census.gov

Usage

census_api_url(
  variables,
  for_geo,
  for_items,
  survey_type,
  survey_or_table_code,
  year,
  ...
)

Arguments

variables

a vector of variables

for_geo

a single geographic level, like "tract" or "block"

for_items

the specific geographies, or "*"

survey_type

e.g. "acs" or "dec"

survey_or_table_code

e.g. "acs5" or "pl"

year

the year of the survey

...

<['dynamic dots'][rlang::dyn-dots]> other items to pass to the query

Value

one URL, as a string

Examples

census_api_url(paste0("B25003_00", 1:3, "E"),
              "tract",
              "*",
              "acs",
              "acs5",
              2020L,
              state = 55L,
              county = 101L)

census_api_url(paste0("P1_00", c(1, 3, 4), "N"),
              "tract",
              "*",
              "dec",
              "pl",
              2020L,
              state = 55L,
              county = 101L)

higherX4Racine/hiRx documentation built on Nov. 18, 2024, 10:20 a.m.