last_update: Last Update Timestamp

Description Usage Arguments Details Value Examples

Description

Produces the timestamp for the last update in GMT.

Usage

1

Arguments

filters

API filters. See the API documentations for additional information.

structure

Structure parameter. See the API documentations for additional information.

Details

This function supplies the API time - i.e. the time at which the data were deployed to the database. Please note that there will always be a difference between this time and the timestamp that is displayed on the website, which may be accessed via the get_release_timestamp() function. The website timestamp signifies the time at which the data were release to the API, and by extension the website.

It may take up to 60 seconds for the data to be updated when the release timestamp (get_release_timestamp()) is updated. This is because the cache must refresh before the new data becomes available. The API timestamp (last_update()), however, is only updated when the cache has been refreshed. This means that you can only be certain that you are receiving the most up-to-data data when the last_update() timestamp for your specific parameters have been updated.

The output of this function is specific to a combination of filters and structure.

Value

closure Timestamp of the last update.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
query_filters <- c(
   "areaType=region"
)

query_structure <- list(
    date = "date", 
    name = "areaName", 
    code = "areaCode", 
    daily = "newCasesBySpecimenDate",
    cumulative = "cumCasesBySpecimenDate"
)

timestamp <- last_update(filters = query_filters, structure = query_structure)

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