Chart of the number of homicides in Chihuahua
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) | |
update <- c(2030, 3156) | |
original <- c(1414, 2523) | |
inegi <- c(2567, NA) | |
hom <- data.frame(year = 2008:2009, | |
updates = update, | |
original = original, | |
inegi = inegi) | |
ggplot(hom, aes(factor(year), updates, group = 1)) + | |
scale_colour_discrete("Source") + | |
geom_line(aes(color = "SNSP")) + | |
geom_line(aes(factor(year), original, color = "SNSP"), | |
linetype = 2) + | |
geom_point(aes(factor(year), inegi, color = "INEGI")) + | |
ylim(0, max(update)) + | |
xlab("year") + | |
ylab("number of homicides") + | |
opts(title = "Discrepancies in Homicide Data for the State of Chihuahua") + | |
annotate("text", x = "2009", y = 2523, label = "original SNSP", | |
hjust = 0) + | |
annotate("text", x = "2009", y = 3156, label = "updated SNSP", | |
hjust = 0) + | |
annotate("text", x = "2008", y = 2567, label = "INEGI", | |
hjust = 1.06) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment