Skip to content

Instantly share code, notes, and snippets.

@diegovalle
Created June 21, 2010 00:40
Show Gist options
  • Save diegovalle/446254 to your computer and use it in GitHub Desktop.
Save diegovalle/446254 to your computer and use it in GitHub Desktop.
Compare the SNSP homicide data for Chihuahua
########################################################
##### Author: Diego Valle Jones
##### Website: www.diegovalle.net
##### Date Created: Sun Jun 20 20:30:49 2010
########################################################
#Compare the SNSP homicide data for Chihuahua
library(ggplot2)
#Chihuahua 2008: 1,414 - SNSP data http://www.icesi.org.mx/documentos/estadisticas/estadisticas/denuncias_homicidio_doloso_1997_2008.xls
#Cd. Juarez 2008: 1653 - http://www.google.com/hostednews/afp/article/ALeqM5g2iONUbtwl8in-a_sCMRSmoX8veA
#Chihuahua 2009: 2,523 - SNSP data http://www.icesi.org.mx/documentos/estadisticas/estadisticasOfi/denuncias_homicidio_doloso_1997_2009.xls
#Cd. Juarez 2009: 2642 - http://www.elpasotimes.com/ci_15330896?source=most_emailed
df <- data.frame(Region = c("Chihuahua", "Juarez"),
year = rep(c(2008, 2009), each = 2),
homicides = c(1414, 1653, 2523, 2642))
ggplot(df, aes(x = factor(year), y = homicides,
fill = Region)) +
opts(title = "In both years Chihuahua's biggest city had more homicides\nthan the whole state according to police records") +
geom_bar(stat = "identity", position = "dodge") +
ylab("number of homicides") + xlab("year")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment