get_data: Get Data

Description Usage Arguments Details Value Examples

Description

Extracts paginated data by requesting all of the pages and combining the results.

Usage

1
get_data(filters, structure, latest_by = NULL)

Arguments

filters

API filters.

structure

Structure parameter.

latest_by

Retrieves the latest value for a specific metric. Must be set to a value that is defined in the structure. (Default: NULL)

Details

For additional information and up-to-date details on arguments and what they represent, please visit the API documentations.

Value

list Data for the given filters and structure.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# We would like to download all cases data at `region` level. 
# We start off by defining our `filters` argument:
query_filters <- c(
   "areaType=region"
)

# Next, we define the structure:
query_structure <- list(
    date = "date", 
    name = "areaName", 
    code = "areaCode", 
    daily = "newCasesBySpecimenDate",
    cumulative = "cumCasesBySpecimenDate"
)

# We then pass these arguments to the `get_data` function:
data <- get_data(filters = query_filters, structure = query_structure)

publichealthengland/coronavirus-dashboard-api-R-sdk documentation built on Aug. 26, 2020, 9:40 a.m.