Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@diegovalle
Created August 4, 2010 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diegovalle/508761 to your computer and use it in GitHub Desktop.
Save diegovalle/508761 to your computer and use it in GitHub Desktop.
Plot CISEN execution data and compare it to that reported by Milenio
#Plot CISEN execution data and compare it to that reported by Milenio
library(ggplot2)
execu <- read.csv("http://spreadsheets.google.com/pub?key=0AjjLwVYbDGx7dGl3VVRza3JJT3pLQlBqZVNVUGh6SHc&hl=en&single=true&gid=0&output=csv")
mexecu <- melt(execu[3:6], id = c("Year","Month"))
mexecu$date <- as.Date(paste(mexecu$Year, mexecu$Month, "15",
sep = "-"),
format = "%Y-%b-%d")
ggplot(mexecu, aes(date, value, group = variable, color = variable)) +
geom_line(size = 1.2) +
scale_x_date() +
ylab("number of executions") +
scale_y_continuous(limits = c(0, 1400)) +
opts(title = "Executions linked to Drug Cartels in Mexico")
dev.print(png, "cisen-vs-milenio.png", width = 640, height = 380)
cisen <- subset(mexecu, variable == "CISEN")
names(cisen)[4] <- "CISEN"
ggplot(cisen, aes(date, CISEN)) +
geom_line(size = 1.2) +
scale_x_date() +
ylab("number of executions") +
scale_y_continuous(limits = c(0, 1400)) +
opts(title = "Executions linked to Drug Cartels in Mexico according to the\nCenter for Research and National Security (CISEN)")
dev.print(png, "cisen-exec.png", width = 640, height = 380)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment