Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The visualisation chosen had the following three main issues:
Reference
The following code was used to fix the issues identified in the original.
library(dplyr)
library(ggplot2)
library(lubridate)
covid <- read.csv("owid-covid-data.csv")
covid$date <- as.Date(covid$date)
europe <- covid %>%
select(continent, location, date, total_cases,total_deaths) %>%
filter(continent == "Europe") %>%
group_by(date) %>%
summarise(Confirmed_Cases = sum(total_cases, na.rm = TRUE),
Deaths = sum(total_deaths, na.rm = TRUE)) %>%
mutate(CFR = round(Deaths / Confirmed_Cases * 100, 2))
europe <- subset(europe, date >= "2020-03-01" & date < "2022-04-30")
p <- ggplot(data = europe, aes(x = date, y = CFR))
p <- p + geom_line() +
geom_vline(xintercept = as.numeric(ymd("2021-05-01")), linetype="dashed", color = "blue") +
geom_text(aes(x = as.Date("2021-05-01"), label = "After 10% double vaccinated", y = 5), angle = 90, vjust = 1.5, text = element_text(size = 8)) +
geom_text(aes(x = as.Date("2021-05-01"), label = "Before 10% double vaccinated", y = 5), angle = 90, vjust = -1, text = element_text(size = 8)) +
labs(title = "Europe's Case Fatality Rate (CFR)",
y = "Case Fatality Rate (CFR)",
x = "Time Period") +
theme_minimal()
Data Reference
The following plot fixes the main issues in the original.