From 1a30ae0c0233522b9432e5ba004253e7f3d02838 Mon Sep 17 00:00:00 2001 From: Marcelo Ponce Date: Mon, 17 May 2021 01:07:53 -0400 Subject: [PATCH] Death.toll of COVID19 cases, live updated for pandemics records --- NEWS | 1 + R/pandemics.R | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/NEWS b/NEWS index f2a915cfd..d65ddab10 100644 --- a/NEWS +++ b/NEWS @@ -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 diff --git a/R/pandemics.R b/R/pandemics.R index 9afc279b9..32868285f 100644 --- a/R/pandemics.R +++ b/R/pandemics.R @@ -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!")