## Warning: package 'kableExtra' was built under R version 4.0.2
## Warning: package 'dplyr' was built under R version 4.0.2

Replace with Section Title

  • Make a bullet point.
# R commands go here.
# You can adjust fig.height, and fig.width to make graphs look better.
# For example, for a small graph, try {r fig.width=4, fig.height=4};
# for a graph with two side-by-side panels, try {r fig.height=4}.
  • Intersperse R code chunks with explanatory text as needed.
  • Press the Knit button in the toolbar to process the .Rmd file into an .html (or .pdf or .docx) file.
  • For more information on using R Markdown in RStudio click on “Help > Markdown Quick Reference”, “Help > Cheatsheets > R Markdown Cheat Sheet”, or “Help > Cheatsheets > R Markdown Reference Guide”.
  • Shortcut to Insert R chunk
  • Windows users:Ctrl+Alt+I
  • Mac users: Command+Option+I

Question a: Create a character & a numerical variable.

gender=c("f","f","f", NA, "m","m","m","m")
Income=c(500 ,100, 300, 700, 100,  200,  530, 400 )
Height=c(5.6, 8.9, 6, 5.8, 7, 6.6, 9, 10 )
print(gender)
## [1] "f" "f" "f" NA  "m" "m" "m" "m"
is.character(gender)
## [1] TRUE

Replacing a missing obersavation (NA) in a variable

gender=ifelse(test = is.na(gender)==T, yes =  "f", no =  gender)
print(gender)
## [1] "f" "f" "f" "f" "m" "m" "m" "m"

Combine vectors(Variables) to create a dataframe(dataset)

Data_new=data.frame(gender=c("f","f","f", NA, "m","m","m","m"),
Income=c(500 ,100, 300, 700, 100,  200,  530, 400 ),
Height=c(5.6, 8.9, 6, 5.8, 7, 6.6, 9, 10 ))
#check the dimension of the data.
dim(Data_new)
## [1] 8 3
#print the data set(data frame).
print(Data_new)
##   gender Income Height
## 1      f    500    5.6
## 2      f    100    8.9
## 3      f    300    6.0
## 4   <NA>    700    5.8
## 5      m    100    7.0
## 6      m    200    6.6
## 7      m    530    9.0
## 8      m    400   10.0

Loading dataset from Stata data file (.dta file)

library(haven)
#set working directory.
setwd("~/Documents/R_programming")
#Give a name to the data to be imported and import it from the set directory.
bexar_covid=read_dta("bexar-covid.dta")

Extracting data directly from packages

#install.packages("covid19.analytics")
library(covid19.analytics)
## Warning: package 'covid19.analytics' was built under R version 4.0.2
#covid19.genomic.data() 
data<-covid19.data("ts-confirmed")
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv
## Data retrieved on 2020-09-09 18:00:56 || Range of dates on data: 2020-01-22--2020-09-08 | Nbr of records: 266
## --------------------------------------------------------------------------------
# specify a location
report.summary(geo.loc="NorthAmerica")
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv
## Data retrieved on 2020-09-09 18:00:57 || Range of dates on data: 2020-01-22--2020-09-08 | Nbr of records: 266
## --------------------------------------------------------------------------------
##  >>> checking data integrity...
## No critical issues have been found.
##  >>> checking data consistency...
## Warning in consistency.check(data, n0, nf, datasetName, details): Inconsistency
## of type.II in ts-confirmed data detected -- 51 records (out of 266) show
## inconsistencies in the data...
## [1] "NORTHAMERICA"
## [1] "CANADA" "US"     "MEXICO"
## Warning in if (!(toupper(geo.ind) %in% provinces.states) & !(toupper(geo.ind)
## %in% : the condition has length > 1 and only the first element will be used
## ################################################################################ 
##   ##### TS-CONFIRMED Cases  -- Data dated:  2020-09-08  ::  2020-09-09 18:00:58 
## ################################################################################ 
##   Number of Countries/Regions reported:  3 
##   Number of Cities/Provinces reported:  15 
##   Unique number of distinct geographical locations combined: 16 
## -------------------------------------------------------------------------------- 
##   For selected locations ts-confirmed  Totals: 7105626 
## -------------------------------------------------------------------------------- 
##    Country.Region            Province.State  Totals RelPerc GlobalPerc LastDayChange   t-2   t-3   t-7  t-14  t-30
## 1              US                           6327009   89.04      22.95         26387 24257 31395 39670 44109 49536
## 2          Mexico                            642860    9.05       2.33          5351  3486  4614  4921  5267  5558
## 3          Canada                    Quebec   63876    0.90       0.23           163   216   205   132   142   156
## 4          Canada                   Ontario   45545    0.64       0.17           231   158   137   154   117   120
## 5          Canada                   Alberta   15093    0.21       0.05           619     0     0   114   127   257
## 6          Canada          British Columbia    6591    0.09       0.02           429     0     0   104    62   131
## 7          Canada              Saskatchewan    1669    0.02       0.01             7    11     8     2     3     5
## 8          Canada                  Manitoba    1349    0.02       0.00            11    15    29    12    25    16
## 9          Canada               Nova Scotia    1086    0.02       0.00             0     1     0     0     1     0
## 10         Canada Newfoundland and Labrador     270    0.00       0.00             0     0     0     0     0     1
## -------------------------------------------------------------------------------- 
##   Global Perc. Average:  1.61 (sd: 5.72) 
##   Global Perc. Average in top  10 :  2.58 (sd: 7.19) 
## -------------------------------------------------------------------------------- 
## ================================================================================
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv
## Data retrieved on 2020-09-09 18:00:58 || Range of dates on data: 2020-01-22--2020-09-08 | Nbr of records: 266
## --------------------------------------------------------------------------------
##  >>> checking data integrity...
## No critical issues have been found.
##  >>> checking data consistency...
## Warning in consistency.check(data, n0, nf, datasetName, details): Inconsistency
## of type.II in ts-deaths data detected -- 39 records (out of 266) show
## inconsistencies in the data...

## [1] "CANADA"
## [1] "US"
## [1] "MEXICO"
## ################################################################################ 
##   ##### TS-DEATHS Cases  -- Data dated:  2020-09-08  ::  2020-09-09 18:00:59 
## ################################################################################ 
##   Number of Countries/Regions reported:  3 
##   Number of Cities/Provinces reported:  15 
##   Unique number of distinct geographical locations combined: 16 
## -------------------------------------------------------------------------------- 
##   For selected locations ts-deaths  Totals: 267340 
## -------------------------------------------------------------------------------- 
##    Country.Region            Province.State Totals  Perc LastDayChange t-2 t-3  t-7 t-14 t-30
## 1              US                           189653  3.00           445 267 403 1056 1225  527
## 2          Mexico                            68484 10.65           703 223 232  575  626  705
## 3          Canada                    Quebec   5770  9.03             0   1   0    2    1    1
## 4          Canada                   Ontario   2862  6.28             0   1   2    0    3    0
## 5          Canada                   Alberta    247  1.64             5   0   0    1    0    5
## 6          Canada          British Columbia    213  3.23             2   0   0    0    0    0
## 7          Canada               Nova Scotia     65  5.99             0   0   0    0    0    0
## 8          Canada              Saskatchewan     24  1.44             0   0   0    0    1    0
## 9          Canada                  Manitoba     16  1.19             0   0   0    0    0    0
## 10         Canada Newfoundland and Labrador      3  1.11             0   0   0    0    0    0
## -------------------------------------------------------------------------------- 
## -------------------------------------------------------------------------------- 
## ================================================================================
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv
## Data retrieved on 2020-09-09 18:00:59 || Range of dates on data: 2020-01-22--2020-09-08 | Nbr of records: 253
## --------------------------------------------------------------------------------
##  >>> checking data integrity...
## No critical issues have been found.
##  >>> checking data consistency...
## Warning in consistency.check(data, n0, nf, datasetName, details): Inconsistency
## of type.II in ts-recovered data detected -- 74 records (out of 253) show
## inconsistencies in the data...

## [1] "CANADA"
## [1] "US"
## [1] "MEXICO"
## ################################################################################ 
##   ##### TS-RECOVERED Cases  -- Data dated:  2020-09-08  ::  2020-09-09 18:01:00 
## ################################################################################ 
##   Number of Countries/Regions reported:  3 
##   Number of Cities/Provinces reported:  1 
##   Unique number of distinct geographical locations combined: 3 
## -------------------------------------------------------------------------------- 
##   For selected locations ts-recovered  Totals: 3013672 
## -------------------------------------------------------------------------------- 
##   Country.Region Province.State  Totals LastDayChange   t-2   t-3   t-7  t-14  t-30
## 1             US                2359111         25560 17556 13808 29094 30766 13891
## 2         Mexico                 535141          3807  6665  5825  2819  2991  8728
## 3         Canada                 119420          1034   194   224   434   411  2630
## -------------------------------------------------------------------------------- 
## -------------------------------------------------------------------------------- 
## ================================================================================
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/09-08-2020.csv

## [1] "CANADA"
## [1] "US"
## [1] "MEXICO"
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  CONFIRMED Cases  -- Data dated:  2020-09-09  ::  2020-09-09 18:01:01 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 3 
##   Number of Cities/Provinces reported: 102 
##   Unique number of distinct geographical locations combined: 3316 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##                       Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered Active Perc.Active
## 1  Los Angeles, California, US    249241           0.90   6036        2.42         0           0.00 243205       97.58
## 2      Miami-Dade, Florida, US    162026           0.59   2666        1.65         0           0.00 159360       98.35
## 3        Maricopa, Arizona, US    136040           0.49   3093        2.27         0           0.00 132947       97.73
## 4           Cook, Illinois, US    132072           0.48   5098        3.86         0           0.00 126974       96.14
## 5            Harris, Texas, US    112039           0.41   2342        2.09         0           0.00 109697       97.91
## 6     Ciudad de Mexico, Mexico    106769           0.39  10986       10.29     88039          82.46   7744        7.25
## 7            Dallas, Texas, US     74100           0.27   1011        1.36         0           0.00  73089       98.64
## 8         Broward, Florida, US     73556           0.27   1234        1.68         0           0.00  72322       98.32
## 9               Mexico, Mexico     71618           0.26   8367       11.68     59697          83.35   3554        4.96
## 10        Queens, New York, US     70766           0.26   7235       10.22         0           0.00  63531       89.78
## ============================================================================================================================================
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  DEATHS Cases  -- Data dated:  2020-09-09  ::  2020-09-09 18:01:01 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 3 
##   Number of Cities/Provinces reported: 102 
##   Unique number of distinct geographical locations combined: 3316 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##                       Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered Active Perc.Active
## 1     Ciudad de Mexico, Mexico    106769           0.39  10986       10.29     88039          82.46   7744        7.25
## 2               Mexico, Mexico     71618           0.26   8367       11.68     59697          83.35   3554        4.96
## 3          Kings, New York, US     65757           0.24   7298       11.10         0           0.00  58459       88.90
## 4         Queens, New York, US     70766           0.26   7235       10.22         0           0.00  63531       89.78
## 5  Los Angeles, California, US    249241           0.90   6036        2.42         0           0.00 243205       97.58
## 6               Quebec, Canada     63876           0.23   5770        9.03     56162          87.92   1944        3.04
## 7           Cook, Illinois, US    132072           0.48   5098        3.86         0           0.00 126974       96.14
## 8          Bronx, New York, US     51984           0.19   4927        9.48         0           0.00  47057       90.52
## 9             Veracruz, Mexico     29928           0.11   3835       12.81     24718          82.59   1375        4.59
## 10              Puebla, Mexico     28357           0.10   3715       13.10     23459          82.73   1183        4.17
## ============================================================================================================================================
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  RECOVERED Cases  -- Data dated:  2020-09-09  ::  2020-09-09 18:01:01 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 3 
##   Number of Cities/Provinces reported: 102 
##   Unique number of distinct geographical locations combined: 3316 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##                    Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered   Active Perc.Active
## 1             Recovered, US         0           0.00      0         NaN   2359111            Inf -2359111        -Inf
## 2  Ciudad de Mexico, Mexico    106769           0.39  10986       10.29     88039          82.46     7744        7.25
## 3            Mexico, Mexico     71618           0.26   8367       11.68     59697          83.35     3554        4.96
## 4            Quebec, Canada     63876           0.23   5770        9.03     56162          87.92     1944        3.04
## 5           Ontario, Canada     45545           0.17   2862        6.28     41050          90.13     1633        3.59
## 6        Guanajuato, Mexico     34441           0.12   2361        6.86     29181          84.73     2899        8.42
## 7        Nuevo Leon, Mexico     32062           0.12   2511        7.83     26673          83.19     2878        8.98
## 8           Tabasco, Mexico     29531           0.11   2672        9.05     25767          87.25     1092        3.70
## 9          Veracruz, Mexico     29928           0.11   3835       12.81     24718          82.59     1375        4.59
## 10           Puebla, Mexico     28357           0.10   3715       13.10     23459          82.73     1183        4.17
## ============================================================================================================================================
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  ACTIVE Cases  -- Data dated:  2020-09-09  ::  2020-09-09 18:01:01 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 3 
##   Number of Cities/Provinces reported: 102 
##   Unique number of distinct geographical locations combined: 3316 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##                       Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered Active Perc.Active
## 1  Los Angeles, California, US    249241           0.90   6036        2.42         0              0 243205       97.58
## 2      Miami-Dade, Florida, US    162026           0.59   2666        1.65         0              0 159360       98.35
## 3        Maricopa, Arizona, US    136040           0.49   3093        2.27         0              0 132947       97.73
## 4           Cook, Illinois, US    132072           0.48   5098        3.86         0              0 126974       96.14
## 5            Harris, Texas, US    112039           0.41   2342        2.09         0              0 109697       97.91
## 6            Dallas, Texas, US     74100           0.27   1011        1.36         0              0  73089       98.64
## 7         Broward, Florida, US     73556           0.27   1234        1.68         0              0  72322       98.32
## 8         Queens, New York, US     70766           0.26   7235       10.22         0              0  63531       89.78
## 9            Clark, Nevada, US     61543           0.22   1206        1.96         0              0  60337       98.04
## 10         Kings, New York, US     65757           0.24   7298       11.10         0              0  58459       88.90
## ============================================================================================================================================
##       Confirmed  Deaths  Recovered   Active 
##   Totals 
##       7105626    267340  3013672 NA 
##   Average 
##       2142.83    80.62   908.83  NA 
##   Standard Deviation 
##       8696.44    440.75  41049.15    NA 
##   
## 
##  * Statistical estimators computed considering 3316 independent reported entries
##  >>> checking data integrity...
## No critical issues have been found.

##  
## 
## ******************************************************************************** 
## ********************************  OVERALL SUMMARY******************************** 
## ******************************************************************************** 
##   ****  Time Series  CANADA,US,MEXICO TOTS **** 
##       ts-confirmed   ts-deaths   ts-recovered 
##       7105626    267340  3013672 
##              3.76%       42.41% 
##   ****  Time Series  CANADA,US,MEXICO AVGS **** 
##       ts-confirmed   ts-deaths   ts-recovered 
##       444101.62  16708.75    1004557.33 
##              3.76%       226.2% 
##   ****  Time Series  CANADA,US,MEXICO SDS **** 
##       ts-confirmed   ts-deaths   ts-recovered 
##       1576813.74 49148.07    1191351.21 
##              3.12%       75.55% 
##   
## 
##  * Statistical estimators computed considering 16/16/3 independent reported entries per case-type 
## ********************************************************************************
report.summary(geo.loc="US")
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv
## Data retrieved on 2020-09-09 18:01:02 || Range of dates on data: 2020-01-22--2020-09-08 | Nbr of records: 266
## --------------------------------------------------------------------------------
##  >>> checking data integrity...
## No critical issues have been found.
##  >>> checking data consistency...
## Warning in consistency.check(data, n0, nf, datasetName, details): Inconsistency
## of type.II in ts-confirmed data detected -- 51 records (out of 266) show
## inconsistencies in the data...
## [1] "US"
## ################################################################################ 
##   ##### TS-CONFIRMED Cases  -- Data dated:  2020-09-08  ::  2020-09-09 18:01:03 
## ################################################################################ 
##   Number of Countries/Regions reported:  1 
##   Number of Cities/Provinces reported:  1 
##   Unique number of distinct geographical locations combined: 1 
## -------------------------------------------------------------------------------- 
##   For selected locations ts-confirmed  Totals: 6327009 
## -------------------------------------------------------------------------------- 
##   Country.Region Province.State  Totals RelPerc GlobalPerc LastDayChange   t-2   t-3   t-7  t-14  t-30
## 1             US                6327009     100      22.95         26387 24257 31395 39670 44109 49536
## -------------------------------------------------------------------------------- 
##   Global Perc. Average:  22.95 (sd: NA) 
##   Global Perc. Average in top  1 :  22.95 (sd: NA) 
## -------------------------------------------------------------------------------- 
## ================================================================================
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv
## Data retrieved on 2020-09-09 18:01:03 || Range of dates on data: 2020-01-22--2020-09-08 | Nbr of records: 266
## --------------------------------------------------------------------------------
##  >>> checking data integrity...
## No critical issues have been found.
##  >>> checking data consistency...
## Warning in consistency.check(data, n0, nf, datasetName, details): Inconsistency
## of type.II in ts-deaths data detected -- 39 records (out of 266) show
## inconsistencies in the data...

## [1] "US"
## ################################################################################ 
##   ##### TS-DEATHS Cases  -- Data dated:  2020-09-08  ::  2020-09-09 18:01:04 
## ################################################################################ 
##   Number of Countries/Regions reported:  1 
##   Number of Cities/Provinces reported:  1 
##   Unique number of distinct geographical locations combined: 1 
## -------------------------------------------------------------------------------- 
##   For selected locations ts-deaths  Totals: 189653 
## -------------------------------------------------------------------------------- 
##   Country.Region Province.State Totals Perc LastDayChange t-2 t-3  t-7 t-14 t-30
## 1             US                189653    3           445 267 403 1056 1225  527
## -------------------------------------------------------------------------------- 
## -------------------------------------------------------------------------------- 
## ================================================================================
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv
## Data retrieved on 2020-09-09 18:01:04 || Range of dates on data: 2020-01-22--2020-09-08 | Nbr of records: 253
## --------------------------------------------------------------------------------
##  >>> checking data integrity...
## No critical issues have been found.
##  >>> checking data consistency...
## Warning in consistency.check(data, n0, nf, datasetName, details): Inconsistency
## of type.II in ts-recovered data detected -- 74 records (out of 253) show
## inconsistencies in the data...

## [1] "US"
## ################################################################################ 
##   ##### TS-RECOVERED Cases  -- Data dated:  2020-09-08  ::  2020-09-09 18:01:05 
## ################################################################################ 
##   Number of Countries/Regions reported:  1 
##   Number of Cities/Provinces reported:  1 
##   Unique number of distinct geographical locations combined: 1 
## -------------------------------------------------------------------------------- 
##   For selected locations ts-recovered  Totals: 2359111 
## -------------------------------------------------------------------------------- 
##   Country.Region Province.State  Totals  Perc LastDayChange   t-2   t-3   t-7  t-14  t-30
## 1             US                2359111 37.29         25560 17556 13808 29094 30766 13891
## -------------------------------------------------------------------------------- 
## -------------------------------------------------------------------------------- 
## ================================================================================
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/09-08-2020.csv

## [1] "US"
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  CONFIRMED Cases  -- Data dated:  2020-09-09  ::  2020-09-09 18:01:06 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 1 
##   Number of Cities/Provinces reported: 58 
##   Unique number of distinct geographical locations combined: 3270 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##                       Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered Active Perc.Active
## 1  Los Angeles, California, US    249241           0.90   6036        2.42         0              0 243205       97.58
## 2      Miami-Dade, Florida, US    162026           0.59   2666        1.65         0              0 159360       98.35
## 3        Maricopa, Arizona, US    136040           0.49   3093        2.27         0              0 132947       97.73
## 4           Cook, Illinois, US    132072           0.48   5098        3.86         0              0 126974       96.14
## 5            Harris, Texas, US    112039           0.41   2342        2.09         0              0 109697       97.91
## 6            Dallas, Texas, US     74100           0.27   1011        1.36         0              0  73089       98.64
## 7         Broward, Florida, US     73556           0.27   1234        1.68         0              0  72322       98.32
## 8         Queens, New York, US     70766           0.26   7235       10.22         0              0  63531       89.78
## 9          Kings, New York, US     65757           0.24   7298       11.10         0              0  58459       88.90
## 10           Clark, Nevada, US     61543           0.22   1206        1.96         0              0  60337       98.04
## ============================================================================================================================================
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  DEATHS Cases  -- Data dated:  2020-09-09  ::  2020-09-09 18:01:06 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 1 
##   Number of Cities/Provinces reported: 58 
##   Unique number of distinct geographical locations combined: 3270 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##                       Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered Active Perc.Active
## 1          Kings, New York, US     65757           0.24   7298       11.10         0              0  58459       88.90
## 2         Queens, New York, US     70766           0.26   7235       10.22         0              0  63531       89.78
## 3  Los Angeles, California, US    249241           0.90   6036        2.42         0              0 243205       97.58
## 4           Cook, Illinois, US    132072           0.48   5098        3.86         0              0 126974       96.14
## 5          Bronx, New York, US     51984           0.19   4927        9.48         0              0  47057       90.52
## 6       New York, New York, US     32461           0.12   3175        9.78         0              0  29286       90.22
## 7        Maricopa, Arizona, US    136040           0.49   3093        2.27         0              0 132947       97.73
## 8          Wayne, Michigan, US     32376           0.12   2897        8.95         0              0  29479       91.05
## 9      Miami-Dade, Florida, US    162026           0.59   2666        1.65         0              0 159360       98.35
## 10           Harris, Texas, US    112039           0.41   2342        2.09         0              0 109697       97.91
## ============================================================================================================================================
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  RECOVERED Cases  -- Data dated:  2020-09-09  ::  2020-09-09 18:01:06 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 1 
##   Number of Cities/Provinces reported: 58 
##   Unique number of distinct geographical locations combined: 3270 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##                 Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered   Active Perc.Active
## 1          Recovered, US         0           0.00      0         NaN   2359111            Inf -2359111        -Inf
## 2   Autauga, Alabama, US      1385           0.01     23        1.66         0              0     1362       98.34
## 3   Baldwin, Alabama, US      4609           0.02     42        0.91         0              0     4567       99.09
## 4   Barbour, Alabama, US       617           0.00      7        1.13         0              0      610       98.87
## 5      Bibb, Alabama, US       562           0.00      6        1.07         0              0      556       98.93
## 6    Blount, Alabama, US      1071           0.00     12        1.12         0              0     1059       98.88
## 7   Bullock, Alabama, US       545           0.00     13        2.39         0              0      532       97.61
## 8    Butler, Alabama, US       859           0.00     37        4.31         0              0      822       95.69
## 9   Calhoun, Alabama, US      2602           0.01     31        1.19         0              0     2571       98.81
## 10 Chambers, Alabama, US       857           0.00     40        4.67         0              0      817       95.33
## ============================================================================================================================================
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  ACTIVE Cases  -- Data dated:  2020-09-09  ::  2020-09-09 18:01:06 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 1 
##   Number of Cities/Provinces reported: 58 
##   Unique number of distinct geographical locations combined: 3270 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##                       Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered Active Perc.Active
## 1  Los Angeles, California, US    249241           0.90   6036        2.42         0              0 243205       97.58
## 2      Miami-Dade, Florida, US    162026           0.59   2666        1.65         0              0 159360       98.35
## 3        Maricopa, Arizona, US    136040           0.49   3093        2.27         0              0 132947       97.73
## 4           Cook, Illinois, US    132072           0.48   5098        3.86         0              0 126974       96.14
## 5            Harris, Texas, US    112039           0.41   2342        2.09         0              0 109697       97.91
## 6            Dallas, Texas, US     74100           0.27   1011        1.36         0              0  73089       98.64
## 7         Broward, Florida, US     73556           0.27   1234        1.68         0              0  72322       98.32
## 8         Queens, New York, US     70766           0.26   7235       10.22         0              0  63531       89.78
## 9            Clark, Nevada, US     61543           0.22   1206        1.96         0              0  60337       98.04
## 10         Kings, New York, US     65757           0.24   7298       11.10         0              0  58459       88.90
## ============================================================================================================================================
##       Confirmed  Deaths  Recovered   Active 
##   Totals 
##       6327009    189653  2359111 NA 
##   Average 
##       1934.87    58  721.44  NA 
##   Standard Deviation 
##       8222.09    309.24  41254.8 NA 
##   
## 
##  * Statistical estimators computed considering 3270 independent reported entries
##  >>> checking data integrity...
## No critical issues have been found.

##  
## 
## ******************************************************************************** 
## ********************************  OVERALL SUMMARY******************************** 
## ******************************************************************************** 
##   ****  Time Series  US TOTS **** 
##       ts-confirmed   ts-deaths   ts-recovered 
##       6327009    189653  2359111 
##              3%      37.29% 
##   ****  Time Series  US AVGS **** 
##       ts-confirmed   ts-deaths   ts-recovered 
##       6327009    189653  2359111 
##              3%      37.29% 
##   ****  Time Series  US SDS **** 
##       ts-confirmed   ts-deaths   ts-recovered 
##       NA NA  NA 
##              NA%         NA% 
##   
## 
##  * Statistical estimators computed considering 1/1/1 independent reported entries per case-type 
## ********************************************************************************
report.summary(geo.loc="Nigeria")
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv
## Data retrieved on 2020-09-09 18:01:06 || Range of dates on data: 2020-01-22--2020-09-08 | Nbr of records: 266
## --------------------------------------------------------------------------------
##  >>> checking data integrity...
## No critical issues have been found.
##  >>> checking data consistency...
## Warning in consistency.check(data, n0, nf, datasetName, details): Inconsistency
## of type.II in ts-confirmed data detected -- 51 records (out of 266) show
## inconsistencies in the data...
## [1] "NIGERIA"
## ################################################################################ 
##   ##### TS-CONFIRMED Cases  -- Data dated:  2020-09-08  ::  2020-09-09 18:01:07 
## ################################################################################ 
##   Number of Countries/Regions reported:  1 
##   Number of Cities/Provinces reported:  1 
##   Unique number of distinct geographical locations combined: 1 
## -------------------------------------------------------------------------------- 
##   For selected locations ts-confirmed  Totals: 55456 
## -------------------------------------------------------------------------------- 
##   Country.Region Province.State Totals RelPerc GlobalPerc LastDayChange t-2 t-3 t-7 t-14 t-30
## 1        Nigeria                 55456     100        0.2           296 155 100 216  221  290
## -------------------------------------------------------------------------------- 
##   Global Perc. Average:  0.2 (sd: NA) 
##   Global Perc. Average in top  1 :  0.2 (sd: NA) 
## -------------------------------------------------------------------------------- 
## ================================================================================
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv
## Data retrieved on 2020-09-09 18:01:08 || Range of dates on data: 2020-01-22--2020-09-08 | Nbr of records: 266
## --------------------------------------------------------------------------------
##  >>> checking data integrity...
## No critical issues have been found.
##  >>> checking data consistency...
## Warning in consistency.check(data, n0, nf, datasetName, details): Inconsistency
## of type.II in ts-deaths data detected -- 39 records (out of 266) show
## inconsistencies in the data...

## [1] "NIGERIA"
## ################################################################################ 
##   ##### TS-DEATHS Cases  -- Data dated:  2020-09-08  ::  2020-09-09 18:01:09 
## ################################################################################ 
##   Number of Countries/Regions reported:  1 
##   Number of Cities/Provinces reported:  1 
##   Unique number of distinct geographical locations combined: 1 
## -------------------------------------------------------------------------------- 
##   For selected locations ts-deaths  Totals: 1067 
## -------------------------------------------------------------------------------- 
##   Country.Region Province.State Totals Perc LastDayChange t-2 t-3 t-7 t-14 t-30
## 1        Nigeria                  1067 1.92             6   4   3   4    3    5
## -------------------------------------------------------------------------------- 
## -------------------------------------------------------------------------------- 
## ================================================================================
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv
## Data retrieved on 2020-09-09 18:01:09 || Range of dates on data: 2020-01-22--2020-09-08 | Nbr of records: 253
## --------------------------------------------------------------------------------
##  >>> checking data integrity...
## No critical issues have been found.
##  >>> checking data consistency...
## Warning in consistency.check(data, n0, nf, datasetName, details): Inconsistency
## of type.II in ts-recovered data detected -- 74 records (out of 253) show
## inconsistencies in the data...

## [1] "NIGERIA"
## ################################################################################ 
##   ##### TS-RECOVERED Cases  -- Data dated:  2020-09-08  ::  2020-09-09 18:01:10 
## ################################################################################ 
##   Number of Countries/Regions reported:  1 
##   Number of Cities/Provinces reported:  1 
##   Unique number of distinct geographical locations combined: 1 
## -------------------------------------------------------------------------------- 
##   For selected locations ts-recovered  Totals: 43334 
## -------------------------------------------------------------------------------- 
##   Country.Region Province.State Totals  Perc LastDayChange t-2 t-3 t-7 t-14 t-30
## 1        Nigeria                 43334 78.14           103 218  91 429  317  160
## -------------------------------------------------------------------------------- 
## -------------------------------------------------------------------------------- 
## ================================================================================
## Data being read from JHU/CCSE repository
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Reading data from https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/09-08-2020.csv

## [1] "NIGERIA"
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  CONFIRMED Cases  -- Data dated:  2020-09-09  ::  2020-09-09 18:01:10 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 1 
##   Number of Cities/Provinces reported: 1 
##   Unique number of distinct geographical locations combined: 1 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##   Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered Active Perc.Active
## 1  Nigeria     55456            0.2   1067        1.92     43334          78.14  11055       19.93
## ============================================================================================================================================
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  DEATHS Cases  -- Data dated:  2020-09-09  ::  2020-09-09 18:01:10 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 1 
##   Number of Cities/Provinces reported: 1 
##   Unique number of distinct geographical locations combined: 1 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##   Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered Active Perc.Active
## 1  Nigeria     55456            0.2   1067        1.92     43334          78.14  11055       19.93
## ============================================================================================================================================
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  RECOVERED Cases  -- Data dated:  2020-09-09  ::  2020-09-09 18:01:10 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 1 
##   Number of Cities/Provinces reported: 1 
##   Unique number of distinct geographical locations combined: 1 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##   Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered Active Perc.Active
## 1  Nigeria     55456            0.2   1067        1.92     43334          78.14  11055       19.93
## ============================================================================================================================================
## ############################################################################################################################################ 
##   ##### AGGREGATED Data  -- ORDERED BY  ACTIVE Cases  -- Data dated:  2020-09-09  ::  2020-09-09 18:01:10 
## ############################################################################################################################################ 
##   Number of Countries/Regions reported: 1 
##   Number of Cities/Provinces reported: 1 
##   Unique number of distinct geographical locations combined: 1 
## -------------------------------------------------------------------------------------------------------------------------------------------- 
##   Location Confirmed Perc.Confirmed Deaths Perc.Deaths Recovered Perc.Recovered Active Perc.Active
## 1  Nigeria     55456            0.2   1067        1.92     43334          78.14  11055       19.93
## ============================================================================================================================================
##       Confirmed  Deaths  Recovered   Active 
##   Totals 
##       55456  1067    43334   11055 
##   Average 
##       55456  1067    43334   11055 
##   Standard Deviation 
##       NA NA  NA  NA 
##   
## 
##  * Statistical estimators computed considering 1 independent reported entries
##  >>> checking data integrity...
## No critical issues have been found.

##  
## 
## ******************************************************************************** 
## ********************************  OVERALL SUMMARY******************************** 
## ******************************************************************************** 
##   ****  Time Series  NIGERIA TOTS **** 
##       ts-confirmed   ts-deaths   ts-recovered 
##       55456  1067    43334 
##              1.92%       78.14% 
##   ****  Time Series  NIGERIA AVGS **** 
##       ts-confirmed   ts-deaths   ts-recovered 
##       55456  1067    43334 
##              1.92%       78.14% 
##   ****  Time Series  NIGERIA SDS **** 
##       ts-confirmed   ts-deaths   ts-recovered 
##       NA NA  NA 
##              NA%         NA% 
##   
## 
##  * Statistical estimators computed considering 1/1/1 independent reported entries per case-type 
## ********************************************************************************