Created
November 15, 2020 21:28
-
-
Save stephenc/ae4a382d487e1973bf78b38bea9ac012 to your computer and use it in GitHub Desktop.
A simple analysis of SARS-CoV-2 cases in Ireland with respect to Lockdown 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(dplyr) | |
library(lubridate) | |
library(ggthemes) | |
owid <- dplyr::mutate(read.csv('owid-covid-data.csv'), Date=as.Date(date)) | |
png("basic.png",width=1024,height=512) | |
ggplot(data=(owid %>% filter(iso_code=='IRL')),aes(x=Date,y=new_cases))+ | |
geom_point()+ | |
geom_smooth(data=(owid %>% filter(iso_code=='IRL') %>% filter(Date >= as.Date('2020-10-15'))),method=lm,color="red",fill="#69b3a2", se=TRUE)+ | |
geom_vline(xintercept=as.Date("2020-10-21"),color="blue")+ | |
geom_text(aes(x=as.Date('2020-10-21'),y=500,label="Level 5 lockdown"),angle=90,color="blue")+ | |
scale_x_date(limits=as.Date(c('2020-10-01','2020-11-15')))+ | |
geom_vline(xintercept=as.Date("2020-10-28"),color="darkgreen")+ | |
geom_text(aes(x=as.Date('2020-10-28'),y=500,label="One week later"),angle=90,color="darkgreen")+ | |
ylab("Daily new cases per 1 million")+ | |
theme_calc() | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment