Package ‘COVID19’
January 6, 2021
Type Package
Title R Interface to COVID-19 Data Hub
Version 2.3.2
Description Download COVID-19 data across governmental sources at national, re-
gional, and city level, as described in Guidotti and Ardia (2020) <doi:10.21105/joss.02376>. In-
cludes the time series of vaccines, tests, cases, deaths, recovered, hospitalizations, intensive ther-
apy, and policy measures by 'Oxford COVID-19 Government Re-
sponse Tracker' <[Link]
response-tracker>. Provides a seamless integra-
tion with 'World Bank Open Data' <[Link] 'Google Mobility Re-
ports' <[Link] 'Apple Mobility Re-
ports' <[Link]
License MIT + file LICENSE
URL [Link]
BugReports [Link]
Encoding UTF-8
LazyData true
Depends R (>= 3.5.0)
Imports utils, dplyr, tidyr (>= 1.0.0)
Suggests wbstats
RoxygenNote 7.1.0
NeedsCompilation no
Author Emanuele Guidotti [aut, cre] (<[Link]
David Ardia [ctb] (<[Link]
Maintainer Emanuele Guidotti <[Link]@[Link]>
Repository CRAN
Date/Publication 2021-01-06 11:40:02 UTC
1
2 covid19
R topics documented:
covid19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
covid19cite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Index 6
covid19 COVID-19 Data Hub
Description
Download COVID-19 data across governmental sources at national, regional, and city level. In-
cludes the time series of vaccines, tests, cases, deaths, recovered, hospitalizations, intensive therapy,
and policy measures by Oxford COVID-19 Government Response Tracker. Provides a seamless in-
tegration with World Bank Open Data, Google Mobility Reports, Apple Mobility Reports.
Usage
covid19(
country = NULL,
level = 1,
start = "2010-01-01",
end = [Link](),
raw = TRUE,
vintage = FALSE,
verbose = TRUE,
cache = TRUE,
wb = NULL,
gmr = NULL,
amr = NULL
)
Arguments
country vector of country names or ISO codes (alpha-2, alpha-3 or numeric).
level integer. Granularity level. 1: country-level data. 2: state-level data. 3: lower-
level data.
start the start date of the period of interest.
end the end date of the period of interest.
raw logical. Skip data cleaning? Default TRUE. See details.
vintage logical. Retrieve the snapshot of the dataset that was generated at the end date
instead of using the latest version. Default FALSE.
verbose logical. Print data sources? Default TRUE.
cache logical. Memory caching? Significantly improves performance on successive
calls. Default TRUE.
covid19 3
wb character vector of World Bank indicator codes. See details.
gmr url to the Google Mobility Report dataset. See details.
amr url to the Apple Mobility Report dataset. See details.
Details
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.
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 [Link]
[Link] is [Link]. The latest data available between the start and end date are down-
loaded.
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 here.
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 here.
Refer to this webpage for more details on the data.
Value
Grouped tibble ([Link]). See the dataset documentation
Note
We have invested a lot of time and effort in creating COVID-19 Data Hub, please:
• cite Guidotti and Ardia (2020) when using COVID-19 Data Hub.
• place the URL [Link] in a footnote to help others find COVID-19
Data Hub.
• you assume full risk for the use of COVID-19 Data Hub. We try our best to guarantee the
data quality and consistency and the continuous filling of the Data Hub. However, it is free
software and comes with ABSOLUTELY NO WARRANTY. Reliance on COVID-19 Data
Hub for medical guidance or use of COVID-19 Data Hub in commerce is strictly prohibited.
Source
[Link]
References
Guidotti, E., Ardia, D., (2020), "COVID-19 Data Hub", Journal of Open Source Software 5(51):2376,
doi: 10.21105/joss.02376.
4 covid19cite
Examples
## Not run:
# Worldwide data by country
x <- covid19()
# Worldwide data by state
x <- covid19(level = 2)
# Specific country data by city
x <- covid19(c("Italy","US"), level = 3)
# Merge with World Bank data. It may take some time...
wb <- c("gdp" = "[Link]", "hosp_beds" = "[Link]")
x <- covid19(wb = wb)
# Merge with Google Mobility Reports. It may take some time...
gmr <- "[Link]
x <- covid19(gmr = gmr)
# Merge with Apple Mobility Reports. It may take some time...
amr <- "[Link]
amr <- paste0(amr, "2023HotfixDev26/v3/en-us/[Link]")
x <- covid19(amr = amr)
# Data sources
s <- covid19cite(x)
View(s)
## End(Not run)
covid19cite COVID-19 Data Hub Data Sources
Description
Retrieve citation and metadata of the data sources.
Usage
covid19cite(x, verbose = TRUE)
Arguments
x dataset returned by covid19.
verbose logical. Print citation? Default TRUE.
covid19cite 5
Value
[Link] of data sources.
Examples
## Not run:
# Download data
x <- covid19("USA")
# Data Sources
s <- covid19cite(x)
View(s)
## End(Not run)
Index
covid19, 2, 4
covid19cite, 4