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
29678d19
Commit
29678d19
authored
Aug 21, 2020
by
Facundo Muñoz
®️
Browse files
Simplify an innecessary intermediate object and fix notes about population units.
parent
81ccb62f
Pipeline
#16561
passed with stage
in 4 minutes and 4 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Covid19MortalityEurope.Rmd
View file @
29678d19
...
...
@@ -124,19 +124,6 @@ Lock <- do.call(
# pull(n) %>%
# identical(rep(1L, length(.)))
deaths_by_ctry_dt <- covid %>%
group_by(date, name) %>%
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")
...
...
@@ -151,7 +138,7 @@ country_data <-
## filter(name != "Liechtenstein") %>%
mutate_if(is.character, as.factor) %>%
left_join(
deaths_by_ctry_dt
%>%
covid
%>%
group_by(name) %>%
summarise(
cum_deaths = sum(deaths),
...
...
@@ -161,7 +148,6 @@ country_data <-
) %>%
mutate(
## Cumulated number of deaths per 100 K hab.
## Note that pop is expressed in thousands.
death_rate = 1e5 * (cum_deaths / pop)
) %>%
## Arrange rows by descending order of death rate
...
...
@@ -169,7 +155,11 @@ country_data <-
## Deaths by country and date of European countries
## with population and lockdown date added
Dfr <- deaths_by_ctry_dt %>%
Dfr <-
covid %>%
select(date, name, deaths) %>%
mutate(date = as.Date(date)) %>%
arrange(date, name) %>%
inner_join(
country_data,
by = "name"
...
...
@@ -199,7 +189,7 @@ ttnd <- sum(Dfr$deaths)
## character string for overall number of deaths
sttnd <- format(ttnd, big.mark = ",")
## overall population size
(in thousands)
## overall population size
ttpop <- sum(country_data$pop)
## character string for overall pop size
...
...
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