geom_parliament_bar: Add a bar showing proportion of seats by party in parliament

Description Usage Arguments Author(s) Examples

Description

Add a bar showing proportion of seats by party in parliament

Usage

1
geom_parliament_bar(colour = colour, party = party, label = TRUE)

Arguments

colour

The colours associated with each political party.

party

The party name variable in your data frame.

label

If label = TRUE, print the percentage above the bar.

Author(s)

Zoe Meers

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)
ggplot2::ggplot(usa_data, ggplot2::aes(x, y, colour = party_long)) +
geom_parliament_seats() +
geom_parliament_bar(colour, party_long) +
ggplot2::scale_colour_manual(values = usa_data$colour, limits = usa_data$party_long)  +
theme_ggparliament()

Example output



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