fetch_data: Fetch data from the healthdata.gov API

Description Usage Arguments Value Examples

View source: R/healthdata-api.R

Description

This function will download data from healthdata.gov, when supplied a tibble created with fetch_catalog(). The function will search for data products that are available in CSV format.CSV is chosen because it's the most common and simplest format available to download directly from the API.

Usage

1
fetch_data(catalog)

Arguments

catalog

this argument requires a catalog (tibble) created with fetch_catalog()

Value

a tibble with descriptive metadata of a data product and a list-column of the available dataset.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
cdc_alc <- fetch_catalog("Centers for Disease Control and Prevention",
  keyword = "alcohol|alcohol use"
)

nested_df_alc <- cdc_alc %>%
  # pull Alzheimer's and Chronic Indicators datasets
  dplyr::slice(1:2) %>%
  fetch_data()

## End(Not run)

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