fetch_json_as_list: Make a call to the Census API and convert the JSON response...

View source: R/fetch_json_as_list.R

fetch_json_as_listR Documentation

Make a call to the Census API and convert the JSON response to an R list.

Description

Make a call to the Census API and convert the JSON response to an R list.

Usage

fetch_json_as_list(
  variables,
  year,
  for_geo,
  for_items,
  survey_type,
  table_or_survey_code,
  ...,
  use_key = TRUE
)

Arguments

variables

<chr[]> a vector of variable names, like "B01001_001E"

year

an integer year, e.g. 2021L

for_geo

<chr> the geographical level the data will describe, e.g. "tract"

for_items

<chr[]> one or more instances of for_geo desired, e.g. "*" or "000200", passed on to build_for_geographies()

survey_type

e.g. "acs" or "dec"

table_or_survey_code

e.g. "acs5" or "pl"

...

<dynamic dots> other items to pass to the query

use_key

<lgl?> optional, should the query include a Census API key from the system environment. Defaults to TRUE

Value

a list of items read from json

See Also

build_api_url()

jsonlite::read_json()


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