download_oxford_npi_data: Download Oxford non-pharmaceutical interventions data

View source: R/download_oxford_npi_data.R

download_oxford_npi_dataR Documentation

Download Oxford non-pharmaceutical interventions data

Description

Downloads non-pharmaceutical interventions (NPI) data related to Covid-19 from the Oxford Covid-19 Government Response Tracker. (https://www.bsg.ox.ac.uk/research/research-projects/oxford-covid-19-government-response-tracker). It currently only uses the policy measures from that data and tidies them into long format, defining observations to be interventions and discarding observations with NA and unchanged 0 measures.

Usage

download_oxford_npi_data(type = "measures", silent = FALSE, cached = FALSE)

Arguments

type

The type of data that you want to retrieve. Can be any subset of

  • "measures": Government response measures, recoded to event-day structure

  • "index": The Strigency Indices as repored by the OxCGRT team

silent

Whether you want the function to send some status messages to the console. Might be informative as downloading will take some time and thus defaults to TRUE.

cached

Whether you want to download the cached version of the data from the tidycovid19 Github repository instead of retrieving the data from the authorative source. Downloading the cached version is faster and the cache is updated daily. Defaults to FALSE.

Details

The Oxford data is currently not included in the data frame produced by download_merged_data() as the ACAPS NPI data seem to be of better quality overall. See this blog post and this Github issue for a discussion.

Value

If only one type was selected, a data frame containing the data. Otherwise, a list containing the desired data frames ordered as in type.

Examples

df <- download_oxford_npi_data(type = "measures", silent = TRUE, cached = TRUE)
df %>%
  dplyr::group_by(country) %>%
  dplyr::summarise(number_of_interventions = dplyr::n()) %>%
  dplyr::arrange(-number_of_interventions)


joachim-gassen/tidycovid19 documentation built on March 21, 2024, 6:57 a.m.