fetch_catalog: Fetch the available catalog from healthdata.gov

Description Usage Arguments Value Examples

View source: R/healthdata-api.R

Description

This function allows users to read the available healthdata.gov catalog into R. The catalog can be downloaded in its entirety, filtered by agency, keyword(s), or both. The catalog consists of name and description of the available data products in the data API endpoint, as well as distribution metadata (download url, format, modified date...).

Usage

1
fetch_catalog(agency = NULL, keyword = NULL)

Arguments

agency

name of agency to pull in API call. This requires the full agency name in proper case. Function get_agencies() can be used for a list of available agencies. Defaults to NULL.

keyword

keyword(s) to pull in API call. This argument can be supplied on its own or with an agency argument. The keyword argument uses regular expression to detect presence of pattern in a string. Function get_keywords() can be used for a list of exact keywords available in API. Defaults to NULL.

Value

a tibble with descriptive metadata of the available catalog including a nested list-column of the data distribution.

Examples

1
2
3
4
5
6
7
8
## Not run: 
fetch_catalog("Centers for Disease Control and Prevention")

cdc_alc <- fetch_catalog("Centers for Disease Control and Prevention",
  keyword = "alcohol|alcohol use"
)

## End(Not run)

iecastro/healthdatacsv documentation built on Nov. 10, 2020, 2:37 a.m.