Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
UMR-ASTRE
Covid19-Mortality-Visualisation
Commits
1f0238a1
Commit
1f0238a1
authored
Aug 21, 2020
by
Facundo Muñoz
®️
Browse files
Clean-up covid data in plan.
parent
7accfd41
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Covid19MortalityEurope.Rmd
View file @
1f0238a1
...
...
@@ -114,13 +114,29 @@ Lock <- do.call(
})
)
## Sanity checks in covid
## there is exactly one record per country and date
# covid %>% group_by(date, name) %>% count() %>% pull(n) %>% identical(rep(1L, length(.))) # TRUE
## The population is consistent for each country
# covid %>%
# count(name, pop) %>%
# count(name, wt = 1L) %>%
# pull(n) %>%
# identical(rep(1L, length(.)))
deaths_by_ctry_dt <- covid %>%
filter(deaths >= 0) %>%
group_by(date, name) %>%
summarise(deaths = sum(deaths)) %>%
ungroup() %>%
summarise(deaths = sum(deaths), .groups = "drop") %>%
mutate(date = as.Date(date))
# identical(
# deaths_by_ctry_dt,
# covid %>%
# select(date, name, deaths) %>%
# mutate(date = as.Date(date)) %>%
# arrange(date, name)
# )
data_update_date <- format(Sys.Date() - 1,
"%d %b %Y")
...
...
src/plan.R
View file @
1f0238a1
...
...
@@ -63,7 +63,10 @@ plan <- drake_plan(## raw_data = read_excel(
sdt
=
format
(
Sys.Date
(),
"%d %b %Y"
),
covid
=
ecdc_covid19
(
Sys.Date
()
-
1
),
covid
=
ecdc_covid19
(
Sys.Date
()
-
1
)
%>%
# rm some negative records that are obvious errors
# should we use NA instead?
filter
(
deaths
>=
0
),
## ## String notice for data update
## data_update_date = format(Sys.Date() - 1,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment