Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
Add Comment
Please, Sign In to add comment