get_dataset_names {RcensusPkg}R Documentation

get_dataset_names

Description

Get the acronym names and descriptions of the Census Bureau's datasets.

Function produces a data.table of the Census Bureau's dataset acronym names that can be used in other RcensusPkg:: functions calling for a dataset acronym name. See Census Bureau's publicly available datasets for descriptions. Also see All Surveys and Programs

Usage

get_dataset_names(
  vintage = NULL,
  filter_name_str = NULL,
  filter_title_str = NULL,
  ignore_case = TRUE,
  brief = TRUE
)

Arguments

vintage

An optional numeric for the year to select the datasets. If NULL, then all the years are returned.

filter_name_str

An optional character string by which to filter the resultant data.table using the "name" column.

filter_title_str

An optional character string by which to filter the resultant data.table using the "title" column.

ignore_case

A logical which if FALSE will not ignore case in filtering the "title" column.

brief

A logical which if TRUE will return a resultant data.table with just columns "name", "vintage", "title". The default is TRUE.

Value

A list with a data.table of dataset names (named "data") and a vector of unique vintages (named "vintages").

Examples

## Not run: 
  # Requests for Census Bureau descriptions takes well over 10
  #  seconds in most cases.
  library(data.table)
  library(jsonlite)
  library(httr2)
  library(RcensusPkg)

  # Get descriptions/vintages for 2020 datasets with "acs5" in their name.
  acs5_datasets_ls <- RcensusPkg::get_dataset_names(
    vintage = 2020,
    filter_name_str = "acs5/"
  )

## End(Not run)

[Package RcensusPkg version 0.1.5 Index]