GitHub: https://github.com/covid19datahub/R
CRAN: https://cloud.r-project.org/package=COVID19
# install the package
install.packages("COVID19")
# load the package
library("COVID19")
See the full documentation by typing ?covid19
Logical. Skip data cleaning? Default True
. If raw=False
, the raw data are cleaned by filling missing dates with NA
values. This ensures that all locations share the same grid of dates and no single day is skipped. Then, NA
values are replaced with the previous non-NA
value or 0
.
x <- covid19(raw = FALSE)
Logical. Retrieve the snapshot of the dataset that was generated at the end
date instead of using the latest version. Default FALSE
.
To fetch e.g. US data that were accessible on 22th April 2020 type
x <- covid19("USA", end = "2020-04-22", vintage = TRUE)
The vintage data are collected at the end of the day, but published with approximately 48 hour delay, once the day is completed in all the timezones.
The dataset can be extended with World Bank Open Data via the argument wb
, a character vector of indicator codes. The codes can be found by inspecting the corresponding URL. For example, the code of the GDP indicator available at https://data.worldbank.org/indicator/NY.GDP.MKTP.CD is NY.GDP.MKTP.CD
.
The dataset can be extended with Google Mobility Reports via the argument gmr
, the url to the Google CSV file. At the time of writing, the CSV is available at:
gmr <- "https://www.gstatic.com/covid19/mobility/Global_Mobility_Report.csv"
x <- covid19(gmr = gmr)
The dataset can be extended with Apple Mobility Reports via the argument amr
, the url to the Apple CSV file. At the time of writing, the CSV is available at:
We have invested a lot of time and effort in creating COVID-19 Data Hub, please:
License: GPL-3.
Comments