parliament_data: A function that prepares data for parliamentary plots

Description Usage Arguments Author(s) Examples

Description

A function that prepares data for parliamentary plots

Usage

1
2
3
4
parliament_data(election_data = NULL, parl_rows = NULL,
  party_seats = election_data$seats, group = NULL, plot_order = NULL,
  type = c("horseshoe", "semicircle", "circle", "classroom",
  "opposing_benches"))

Arguments

election_data

aggregate election results

parl_rows

number of rows in parliament

party_seats

seats per party

group

grouping variable for separate chunks. e.g. opposing benches in UK parliament

plot_order

plot the data in a specified order

type

type of parliament (horseshoe, semicircle, circle, classroom, opposing benches)

Author(s)

Zoe Meers, Rob Hickman

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data <- election_data[
  election_data$country == "USA" &
  election_data$house == "Representatives" &
  election_data$year == "2016",]
usa_data <- parliament_data(
  election_data = data,
  type = "semicircle",
  party_seats = data$seats,
  parl_rows = 8
)

ggparliament documentation built on May 2, 2019, 3:35 p.m.