Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
plots all contributions over time, colored by party
# load csv
contr <- read.csv("fec-contr.csv")
# convert date column to R date type
contr$date <- strptime(as.character(contr$contb_receipt_dt), "%Y-%m-%dT%H:%M:%SZ")
plot(date,contb_receipt_amt,axes=F,col=color,cex=.7,ylab="",xlab="",main="Contributions in 2011")
# add time axis
axis(2, las=2, cex.axis=0.65)
axis.POSIXct(1, las=2, at=seq(as.Date("2011/1/1"), as.Date("2012/01/01"), by="month"), cex=0.65, cex.axis=0.65, format="%b")
# add labels for biggest contribution
m = subset(contr, contb_receipt_amt > 250000)
text(m$date, m$contb_receipt_amt, m$contbr_nm, cex=.65, pos=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment