Created
February 13, 2012 11:23
-
-
Save gka/1816161 to your computer and use it in GitHub Desktop.
plots all contributions over time, colored by party
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
# 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