| Title: | R Interface to Access UKHSA Dashboard Data |
|---|---|
| Description: | Programmatic interface to access data from the UK Health Security Agency (UKHSA) Data Dashboard API. The package was originally based on the 'ukcovid19' package by Pouria Hadjibagheri and has been substantially rewritten and extended. For more information on the API, see <https://ukhsa-dashboard.data.gov.uk/access-our-data>. |
| Authors: | Ollie Lloyd [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-9385-1634>), Pouria Hadjibagheri [ctb] (Author of the original 'ukcovid19' package.) |
| Maintainer: | Ollie Lloyd <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-10-11 12:43:20 UTC |
| Source: | https://github.com/silverfoxdoc/ukhsadatr |
Iteratively runs get_paginated_data to download all results and
combine them into a data.frame.
get_data( theme = NULL, sub_theme = NULL, topic = NULL, geography_type = NULL, geography = NULL, metric = NULL )get_data( theme = NULL, sub_theme = NULL, topic = NULL, geography_type = NULL, geography = NULL, metric = NULL )
theme |
the largest overall topical subgroup of data. For
example |
sub_theme |
a topical subgroup associated with the parent theme.
For example |
topic |
categorical subgroup associated with the selected
theme and sub_theme. For example, |
geography_type |
the overarching area type for the intended geography.
For example |
geography |
the selected area under the |
metric |
the type of data being selected.
For example |
For further information on the UKHSA dashboard API please visit the API documentation.
If any input argument is left NULL or invalid, a list
of possible values for that parameter is returned.
data.frame containing the query results
get_data( theme = "infectious_disease", sub_theme = "respiratory", topic = "COVID-19", geography_type = "Nation", geography = "England", metric = "COVID-19_cases_casesByDay" ) |> head()get_data( theme = "infectious_disease", sub_theme = "respiratory", topic = "COVID-19", geography_type = "Nation", geography = "England", metric = "COVID-19_cases_casesByDay" ) |> head()
Generates API query URL and retrieves paginated data.
get_paginated_data( theme = NULL, sub_theme = NULL, topic = NULL, geography_type = NULL, geography = NULL, metric = NULL, page_number = 1, page_size = 365 )get_paginated_data( theme = NULL, sub_theme = NULL, topic = NULL, geography_type = NULL, geography = NULL, metric = NULL, page_number = 1, page_size = 365 )
theme |
the largest overall topical subgroup of data. For
example |
sub_theme |
a topical subgroup associated with the parent theme.
For example |
topic |
categorical subgroup associated with the selected
theme and sub_theme. For example, |
geography_type |
the overarching area type for the intended geography.
For example |
geography |
the selected area under the |
metric |
the type of data being selected.
For example |
page_number |
define which page of data to retrieve |
page_size |
define number of results returned per page. Maximum supported size is 365. |
If any input argument is left NULL or invalid, a list
of possible values for that parameter is returned.
list containing the query structure and results
get_paginated_data( theme = "infectious_disease", sub_theme = "respiratory", topic = "COVID-19", geography_type = "Nation", geography = "England", metric = "COVID-19_cases_casesByDay", page_number = 2, page_size = 6 )get_paginated_data( theme = "infectious_disease", sub_theme = "respiratory", topic = "COVID-19", geography_type = "Nation", geography = "England", metric = "COVID-19_cases_casesByDay", page_number = 2, page_size = 6 )