ggswissparl: Plot voting results

View source: R/ggswissparl.R

ggswissparlR Documentation

Plot voting results

Description

ggswissparl plots voting results of the Swiss National Council according to the latest seating order.

Usage

ggswissparl(
  votes,
  seats = NULL,
  highlight,
  result = F,
  result_size = 6,
  point_shape = 16,
  point_size = 4,
  theme = "scoreboard"
)

Arguments

votes

data of votes of the Swiss National Council as can be retrieved with get_data(table = "Voting"). The variables PersonNumber, Decision, and DecisionText must be available from the data.

seats

data linking councillors (PersonNumber) to seats (SeatNumber). If is.null, the most current seating order is retrieved via get_data(table = "SeatOrganisationNr").

highlight

named list with variable and values to specify highlighting of selected councillors.

result

if TRUE, the result is annontated.

result_size

font size of result.

point_shape

shape of point as defined in [ggplot2]{geom_point}.

point_size

size of point.

theme

name of predefined plot theme:

  • "scoreboard" imitates the scoreboard in the council hall: neon-red (yes-votes), neon-green (no-votes) and white (abstentions) dots on black ground in white frames.

  • "sym1" colored symbols on light background in black frames.

  • "sym2" colored symbols on light background without frames.

  • "poly1" color-filled polygons with black edges.

  • "poly2" color-filled polygons with white edges.

  • "poly3" color-filled polygons without edges.

Value

A ggplot object. If votes contains multiple ballots, [ggplot2]{facet_wrap} is used to create facets.

Examples

## Not run: 
# Visualization of a vote of the 51st legislature
get_data("Voting", Language = "DE", IdVote = 23458) %>%
    ggswissparl()

# Highlighting a parliamentary group
get_data("Voting", Language = "DE", IdVote = 23458) %>%
    ggswissparl(highlight = list("ParlGroupNumber" = 2))

## End(Not run)

zumbov2/swissparl documentation built on July 28, 2022, 11:34 a.m.