house_carto: Produce a ProPublica- or GovTrack-style House roll call vote...

Description Usage Arguments Value Note Examples

View source: R/gghouse.r

Description

Produce a ProPublica- or GovTrack-style House roll call vote cartogram

Usage

1
2
house_carto(vote_tally, style = c("pp", "gt", "propublica", "govtrack"),
  pp_square = FALSE)

Arguments

vote_tally

either a pprc object (the result of a call to roll_call()) or a data.frame of vote tallies for the house It expects 3 columns. state_abbrev : the 2-letter U.S. state abbreviation; district : either 1 or 2 to distinguish between each representative; party : R, D or ID; position : yes, no, present, none for how the representative voted.

style

either ProPublica-ish (pp or propublica) or GovTrack-ish (gt or govtrack)

pp_square

if TRUE then no "state borders" will be drawn, but distinct Representative squares. If FALSE then the cartogram will be very close to the ProPublica cartograms.

Value

a ggplot2 object that you can further customize with scales, labels, etc.

Note

No "themeing" is applied to the returned ggplot2 object. You can use theme_voteogram() if you need a base theme. Also, GovTrack-style cartograms will have coord_equal() applied by default.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# what you'd normally do
rep <- roll_call("house", 115, 1, 256)

## End(Not run)

# using a saved object
rep <- readRDS(system.file("extdata", "rep.rds", package="voteogram"))

house_carto(rep, pp_square=TRUE)

voteogram documentation built on May 2, 2019, 11:42 a.m.