General US Historical Representative Data

Author: Brad Cable

Library Loading

library(ggplot2)

Data Loading

repData <- read.csv("rep.txt", header=TRUE)
repData$pop <- repData$pop / 1000000
repData$totalReps <- repData$house + repData$senate
repData$ratio <- repData$totalReps / repData$pop

Population by Year

g <- ggplot(repData, aes(y=pop, x=year))
g <- g + geom_line() + xlab("Year") + ylab("Population (millions)")
g + ggtitle("Population by Year") + theme_bw()

plot of chunk unnamed-chunk-3

Total Representatives by Year

g <- ggplot(repData, aes(y=totalReps, x=year))
g <- g + geom_line() + xlab("Year") + ylab("Total Representatives")
g + ggtitle("Total Representatives by Year") + theme_bw()

plot of chunk unnamed-chunk-4

Representative Ratio by Year

g <- ggplot(repData, aes(y=ratio, x=year))
g <- g + geom_line() + xlab("Year") + ylab("Representation Ratio")
g + ggtitle("Representation Ratio by Year") + theme_bw()

plot of chunk unnamed-chunk-5