Awesome
nCov2019: An R package for exploring COVID-19 statistics
The package was developed since Jan. 2020 and originally hosted on GuangchuangYu/nCov2019. This repo contains an up-to-date version with data from new sources (from worldometers and JHUCSSE) and new data types (vaccine and therapeutics data).
:house: Data Sources
- Latest data of coronavirus cases: worldometers
- Historical data of coronavirus cases : JHUCSSE
- Vaccine data: raps.org
- Therapeutics data: raps.org
Fetching data using API provided by disease.sh
Find out more on the vignette vignette.
:writing_hand: Authors
Guangchuang YU and Tianzhi Wu
If you use nCov2019
, please cite the following article:
Wu T, Hu E, Ge X<sup>*</sup>, Yu G<sup>*</sup>. 2021. nCov2019: an R package for studying the COVID-19 coronavirus pandemic. PeerJ 9:e11421 https://doi.org/10.7717/peerj.11421
:arrow_double_down: Installation
Get the development version from github:
## install.packages("remotes")
remotes::install_github("YuLab-SMU/nCov2019")
:beginner: Usages
res <- query()
to query 5 types of statistics- global summary,
- latest data
- historical data
- vaccine data
- therapeutic data
x <- res$global
to access global summary datasummary(x)
will return global overviewx$affectedCountries
will return total affected countries,(other 20 types of statistics is available)
y <- res$latest
ory <- res$historical
to accesslatest
orhistorical
datay["global"]
will return all countries' statisticsy[country]
will return country level statistics- For countries in
China
,UK
,Australia
,Canada
,Denmark
,France
andNetherlands
, provincial data is also available andy[country,province]
will return statistics data of the selected province
z <- res$vaccine
ory <- res$therapeutics
to accessvaccine
ortherapeutic
datasummary(z)
will return the summary of their trial phasez["all"]
will return all candidatez[ID="id1"]
each vaccine or therapeutics candidate has an id, this will return detail description of the selected candidate (e.g., "id1")
plot()
to present data on mapdashboard()
to open Shiny app dashboard
:art: Example
Run the script example.R in R using source("example.R")
, will produce the following figure:
:book: Documents
:chart_with_upwards_trend: Shiny Apps that use nCov2019
- Coronavirus Tracking dashboard
- Novel Coronavirus Pneumonia (NCP-2019) Dashboard
- Coronavirus COVID-19 outbreak statistics and forecast