Created
May 21, 2018 21:12
-
-
Save cavedave/f7132b92190fb7b8fcbf9f066ddb0147 to your computer and use it in GitHub Desktop.
Guinea worm visualisation
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
year | cases | |
---|---|---|
1986 | 3500000 | |
1989 | 892055 | |
1990 | 623579 | |
1991 | 543585 | |
1992 | 374202 | |
1993 | 229773 | |
1994 | 164977 | |
1995 | 129852 | |
1996 | 152814 | |
1997 | 77863 | |
1998 | 78557 | |
1999 | 96293 | |
2000 | 75223 | |
2001 | 63718 | |
2002 | 54638 | |
2003 | 32193 | |
2004 | 16026 | |
2005 | 10674 | |
2006 | 25217 | |
2007 | 9585 | |
2008 | 4619 | |
2009 | 3190 | |
2010 | 1797 | |
2011 | 1058 | |
2012 | 542 | |
2013 | 148 | |
2014 | 126 | |
2015 | 22 | |
2016 | 25 | |
2017 | 30 |
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(ggthemes) | |
library(MASS) # to access Animals data sets | |
library(scales) | |
library(ggplot2) | |
library(ggthemes) | |
mydata = read.csv("GuineaWorm.csv") | |
mydata2<-mydata %>% select(cases,year) %>% mutate(log2= log(cases)) | |
ggplot(mydata2, aes(year, cases))+ | |
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 = 2012, y = 10, label = "@iamreddave data:Carter Center", size = 3.0)+Guinea Worm Eradication Program | |
annotate("text", x = 1992, y = 3400000, label = "Carter Center Eradication Program Begins", size = 3.0)+ | |
annotate("text", x = 1989, y = 10, label = "WHO Certified Worm Free", size = 3.0)+ | |
annotate("segment", x = 2000, xend = 2000, y = 5, yend = 60, colour = "wheat1", size=4) + | |
annotate("text", x = 2000, y = 15, label = "India", size = 4.0,angle = 90)+ | |
annotate("segment", x = 2000, xend = 2000, y = 6, yend = 35, colour = "firebrick3", size = 0.25)+ | |
annotate("segment", x = 2013, xend = 2013, y = 4, yend = 60, colour = "wheat1", size=4) + | |
annotate("text", x = 2013, y = 15, label = "Nigeria", size = 4.0,angle = 90)+ | |
annotate("segment", x = 2013, xend = 2013, y = 5, yend = 50, colour = "firebrick3", size = 0.25)+ | |
annotate("segment", x = 2011, xend = 2011, y = 2, yend = 200, colour = "wheat1", size=4) + | |
annotate("text", x = 2011, y = 19, label = "Burkino Faso", size = 4.0,angle = 90)+ | |
annotate("segment", x = 2011, xend = 2011, y = 2.5, yend = 125, colour = "firebrick3", size = 0.25)+ | |
annotate("segment", x = 2007, xend = 2007, y = 3, yend = 90, colour = "wheat1", size=4) + | |
annotate("text", x = 2007, y = 17, label = "Cameroon", size = 4.0,angle = 90)+ | |
annotate("segment", x = 2007, xend = 2007, y = 3, yend = 85, colour = "firebrick3", size = 0.25)+ | |
annotate("segment", x = 2004, xend = 2004, y = 5, yend = 60, colour = "wheat1", size=4) + | |
annotate("text", x = 2004, y = 17, label = "Yemen", size = 4.0,angle = 90)+ | |
annotate("segment", x = 2004, xend = 2004, y = 5, yend = 35, colour = "firebrick3", size = 0.25)+ | |
annotate("segment", x = 1996, xend = 1996, y = 4, yend = 70, colour = "wheat1", size=4) + | |
annotate("text", x = 1996, y = 17, label = "Pakistan", size = 4.0,angle = 90)+ | |
annotate("segment", x = 1996, xend = 1996, y = 5, yend = 60, colour = "firebrick3", size = 0.25)+ | |
annotate("segment", x = 2005, xend = 2005, y = 4, yend = 70, colour = "wheat1", size=4) + | |
annotate("text", x = 2005, y = 17, label = "Senegal", size = 4.0,angle = 90)+ | |
annotate("segment", x = 2005, xend = 2005, y = 5, yend = 65, colour = "firebrick3", size = 0.25)+ | |
annotate("segment", x = 2009, xend = 2009, y = 4, yend = 60, colour = "wheat1", size=4) + | |
annotate("text", x = 2009, y = 17, label = "Uganda", size = 4.0,angle = 90)+ | |
annotate("segment", x = 2009, xend = 2009, y = 5, yend = 55, colour = "firebrick3", size = 0.25)+ | |
#geom_smooth(color='darkred')+ | |
ggtitle("Guinea Worm Cases per Year") | |
ggsave("guinea.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment