Skip to content

Commit

Permalink
Death.toll of COVID19 cases, live updated for pandemics records
Browse files Browse the repository at this point in the history
  • Loading branch information
mponce0 committed May 17, 2021
1 parent e8fba27 commit 1a30ae0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Apr 2021: Bugs fixes _ ver 2.2
- pandemics.data (for both historical pandemics and vaccines records): live update of COVID-19 Death.toll cases when loading the datasets
- fix bug in checkGeoLoc and select.per.loc, affecting continents/countries mismatch for some locations/continents, with side-effects on dashboard and totals.plt, ...

Feb/Mar 2021: More data sources added _ ver 2.1
Expand Down
4 changes: 4 additions & 0 deletions R/pandemics.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ pandemics.loaddata <- function(tgt.file="pandemics.RDS",
pnd.data <- readRDS(pnds.RDS)
if (acknowledge) message("Data obtained from",src.descr)
if (show) print(datatable(pnd.data))
# update Death.toll for COVID-19 ongoing pandemic
c19.data <- covid19.data()
nameCol <- which(grepl(toupper("Name.of.Pandemic"),toupper(names(pnd.data))))
pnd.data[ pnd.data[,nameCol]=="CoViD-19","Death.toll"] <- sum(c19.data$Deaths)
return(pnd.data)
} else {
stop("CRITICAL Error:", tgt.file, " missing!")
Expand Down

0 comments on commit 1a30ae0

Please sign in to comment.