The make-up of the United States House of Representatives every two years since 1789. The last Congress included is the 112th Congress, which completes its term in 2013.
data(house)
A data frame with 112 observations on the following 12 variables.
congress
The number of that year's Congress
yearStart
Starting year
yearEnd
Ending year
seats
Total number of seats
p1
Name of the first political party
np1
Number of seats held by the first political party
p2
Name of the second political party
np2
Number of seats held by the second political party
other
Other
vac
Vacancy
del
Delegate
res
Resident commissioner
# NOT RUN {
data(house)
#=====> Examine two-party relationship since 1855 <=====#
these <- 34:112
COL <- c("#EEDDBB", "#DDEEBB", "#DDDDDD",
"#BBDDEE", "#EEE5E5", "#EECCCC")
party <- c("#2222FF", "#FF2222")
par(las=1)
plot(house$yearStart[these], 100*house$np1[these]/house$seats[these],
type="n", xlab="Year", ylab="Percent of House seats", ylim=c(11, 93))
rect(1861.3, -1000, 1865.3, 1000, col=COL[1], border="#FFFFFF")
rect(1914.5, -1000, 1918.9, 1000, col=COL[2], border="#FFFFFF")
rect(1929, -1000, 1939, 1000, col=COL[3], border="#FFFFFF")
rect(1939.7, -1000, 1945.6, 1000, col=COL[4], border="#FFFFFF")
rect(1955.8, -1000, 1965.3, 1000, col=COL[5], border="#E2E2E2")
rect(1965.3, -1000, 1975.4, 1000, col=COL[6], border="#E2E2E2")
lines(house$yearStart[these], 100*house$np1[these]/house$seats[these],
col=party[1])
lines(house$yearStart[these], 100*house$np2[these]/house$seats[these],
col=party[2])
legend("topleft", lty=c(1,1), col=party,
c("Democrats", "Republicans"), bg="#FFFFFF")
legend("topright", fill=COL,
c("Civil War", "World War I", "Great Depression", "World War II",
"Vietnam War Start", "Vietnam War Escalated"),
bg="#FFFFFF", border="#FFFFFF")
# }
Run the code above in your browser using DataLab