Created
November 25, 2021 11:34
-
-
Save cavedave/66979080071f59a49014c8059b33ca12 to your computer and use it in GitHub Desktop.
Wild Polio cases per year https://en.m.wikipedia.org/wiki/Polio_eradication
This file contains hidden or 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
Year | Recorded | |
---|---|---|
1975 | 49293 | |
1980 | 52552 | |
1985 | 38637 | |
1988 | 35251 | |
1990 | 23484 | |
1993 | 10487 | |
1995 | 7035 | |
2000 | 719 | |
2005 | 1979 | |
2010 | 1352 | |
2011 | 650 | |
2012 | 223 | |
2013 | 416 | |
2014 | 359 | |
2015 | 74 | |
2016 | 37 | |
2017 | 22 | |
2018 | 33 | |
2019 | 176 | |
2020 | 140 | |
2021 | 2 |
This file contains hidden or 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(dplyr) | |
library(ggplot2) | |
library(ggthemes) | |
library(scales) | |
mydata = read.csv("Polio.csv", sep=",") | |
mydata2<-mydata %>% select(Recorded,Year) %>% mutate(log2= log(Recorded)) | |
p<- ggplot(mydata2, aes(Year, Recorded))+ | |
theme_update(plot.title = element_text(hjust = 0.5))+ | |
theme_tufte() + | |
geom_point(color='#d498a3') + | |
scale_y_log10(breaks = trans_breaks("log10", function(x) 10^x), | |
labels = trans_format("log10", math_format(10^.x)))+ | |
annotate("text", x = 1994, y = 5, label = "Americas", size = 4.0,angle = 90)+ | |
annotate("segment", x = 1994, xend = 1994, y = 1, yend = 20, colour = "firebrick3", size = 0.25)+ | |
annotate("text", x = 2000, y = 5, label = "Pacific West", size = 4.0,angle = 90)+ | |
annotate("segment", x = 2000, xend = 2000, y = 1, yend = 20, colour = "firebrick3", size = 0.25)+ | |
annotate("text", x = 2015, y = 5, label = "Nigeria", size = 4.0,angle = 90)+ | |
annotate("segment", x = 2015, xend = 2015, y = 2, yend = 16, colour = "firebrick3", size = 0.25)+ | |
annotate("text", x = 2011, y = 5, label = "India", size = 4.0,angle = 90)+ | |
annotate("segment", x = 2011, xend = 2011, y = 2, yend = 13, colour = "firebrick3", size = 0.25)+ | |
annotate("text", x = 2020, y = 5, label = "Africa", size = 4.0,angle = 90)+ | |
annotate("segment", x = 2020, xend = 2020, y = 2, yend = 13, colour = "firebrick3", size = 0.25) | |
#scale_y_continuous(trans='log2')+ | |
#scale_y_sqrt()+ | |
p<-p + ggtitle("Wild Polio Cases per Year") + | |
ylab("Cases (log)") + xlab("Year") +theme_bw()+ theme(plot.title = element_text(hjust = 0.5)) | |
p | |
ggsave("Polio.png") | |
Author
cavedave
commented
Nov 25, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment