geom_parliament_seats: Parliament seats The parliament seats geom is used for...

Description Usage Arguments Author(s) Examples

Description

Parliament seats The parliament seats geom is used for plotting data from parliament_data()

Usage

1
2
3
geom_parliament_seats(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = FALSE, size = 3.5,
  show.legend = NA, inherit.aes = TRUE)

Arguments

mapping

Mapping the aesthetics (the x and y coordinates, as well as the colour of each political party).

data

The parliament_data data frame.

stat

"identity"

position

"identity"

na.rm

If 'FALSE', the default, missing values are removed with a warning. If 'TRUE', missing values are silently removed.

size

Size of the point

show.legend

If 'TRUE', print legend. If 'FALSE' do not print legend.

inherit.aes

Inherit aes from other ggplot2 functions.

Author(s)

Zoe Meers

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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 = x, y = y, colour = party_long)) +
  geom_parliament_seats() +
  theme_ggparliament()

Example output



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