2021/12/16

Installation

To start off, users could utilize the ‘remotes’ package to install it directly from GitHub by running the following in R:

#remotes::install_github("yulab-smu/nCov2019", dependencies = TRUE)

Statistic query

Data query is simple as one command:

library("nCov2019")
res <- query()
## last update: 2021-12-16 
## Gloabl total  272487765  cases; and  5345727  deaths
## Gloabl total affect country or areas: 224
## Gloabl total recovered cases: 77269
## last update: 2021-12-16 
## Total Candidates Programs : 51 
## Total Candidates Programs : 84

Data types

names(res)
## [1] "latest"       "global"       "historical"   "vaccine"      "therapeutics"
x<- res$latest
print(x)
## last update: 2021-12-16

Global

head(x["Global"]) #return all global countries
##   country    cases deaths recovered   active todayCases todayDeaths
## 1     USA 51290979 823390  40343561 10124028     136590        1690
## 2      UK 11010286 146791   9617941  1245554      78610         165
## 3  France  8399846 120983   7395914   882949      65713         151
## 4 Germany  6656161 107675   5559700   988786      55650         509
## 5  Russia 10103160 292891   8839633   970636      28363        1142
## 6   Spain  5393268  88619   4961880   342769      27140          77
##   todayRecovered population     tests    updated
## 1         102204  333823623 781366086 2021-12-16
## 2          43395   68404314 380861666 2021-12-16
## 3          33306   65483478 175073861 2021-12-16
## 4          62400   84173371  87852398 2021-12-16
## 5          35633  146025438 232800000 2021-12-16
## 6           3208   46781107  66213858 2021-12-16

Taiwan

head(x["Taiwan"])
##     country cases deaths recovered active todayCases todayDeaths todayRecovered
## 156  Taiwan 16759    849     15706    204          7           1             10
##     population   tests    updated
## 156   23879442 8772089 2021-12-16

Historical data

Z<- res$historical
print(Z)
## last update: 2021-12-15
head(Z[c('Taiwan','Taipei')])
##      country       date cases deaths recovered
## 173   Taiwan 2020-01-22     1      0         0
## 369   Taiwan 2020-01-23     1      0         0
## 565   Taiwan 2020-01-24     3      0         0
## 761   Taiwan 2020-01-25     3      0         0
## 957   Taiwan 2020-01-26     4      0         0
## 1153  Taiwan 2020-01-27     5      0         0

Vaccine

X <-res$ vaccine
summary(X)
##          phase candidates
## 1      Phase 3         10
## 2    Phase 2/3          3
## 3      Phase 2          2
## 4    Phase 1/2          9
## 5      Phase 1         13
## 6 Pre-clinical         14

All

head(X["all"])
##    id candidate
## 1 id1    BNT162
## 2 id2 mRNA-1273
## 3 id3  Ad5-nCoV
## 4 id4   AZD1222
## 5 id5 CoronaVac
## 6 id6   Covaxin
##                                                                  mechanism
## 1                                                       mRNA-based vaccine
## 2                                                       mRNA-based vaccine
## 3                           Recombinant vaccine (adenovirus type 5 vector)
## 4 Replication-deficient viral vector vaccine (adenovirus from chimpanzees)
## 5                        Inactivated vaccine (formalin with alum adjuvant)
## 6                                                      Inactivated vaccine
##                   sponsors trialPhase
## 1         Pfizer, BioNTech    Phase 3
## 2                  Moderna    Phase 3
## 3        CanSino Biologics    Phase 3
## 4 The University of Oxford    Phase 3
## 5                  Sinovac    Phase 3
## 6           Bharat Biotech    Phase 3
##                                              institutions
## 1 Multiple study sites in Europe, North America and China
## 2  Kaiser Permanente Washington Health Research Institute
## 3                                         Tongji Hospital
## 4                          The University of Oxford,&nbsp
## 5              Sinovac Research and Development Co., Ltd.
## 6

Plot

X <- res$latest
plot(X)

plot(X, type = "tests", palette="Green")