View source: R/download_oxford_npi_data.R
download_oxford_npi_data | R Documentation |
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.
download_oxford_npi_data(type = "measures", silent = FALSE, cached = FALSE)
type |
The type of data that you want to retrieve. Can be any subset of
|
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 |
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 |
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.
If only one type
was selected, a data frame containing the
data. Otherwise, a list containing the desired data frames ordered as
in type
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.