Commit 1abbefad authored by Facundo Muñoz's avatar Facundo Muñoz ®️
Browse files

Report Europe: simplify unnecessary filter and intermediate object with non-descriptive name.

parent 03ceafcd
......@@ -73,10 +73,6 @@ cex <- .7
## string for today
sdt <- format(Sys.Date(), "%d %b %Y")
## Lockdown date in European countries
conf <- base::subset(lockdown_dates,
subset = name %in% european_countries)
## Extract mortality data
dfr <- base::subset(
covid,
......@@ -86,7 +82,7 @@ dfr <- base::subset(
## Add lockdown date
z <- merge(x = aggregate(deaths ~ date + name,
data = dfr, FUN = sum),
y = conf,
y = lockdown_dates,
all.x = T,
by = "name")
z$date <- as.Date(as.character(z$date))
......@@ -620,7 +616,7 @@ z2$date <- as.Date(as.character(z2$date))
## merge covid data with pop size, and lockdonw date
z3 <- merge(merge(pop_countries_2019, z2, by = "name"),
conf,
lockdown_dates,
by = "name")
## define a new variable "day" with day=0 at the frist death
z4 <- do.call(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment