ggplot_parliament2: Create an Arc-Bar Parliament Diagram

Description Usage Arguments Examples

Description

An arc bar diagram that allows for spacing between the individual arc components and spans 180 degrees.

Usage

1
2
3
4
ggplot_parliament2(parties, shares, party_colors = NA, type = c("absolute",
  "proportion"), border_color = "black", text_total = TRUE,
  autosort = FALSE, rad_inner = 1.5, rad_outer = 3, arc_n = 360,
  sep = 0.05)

Arguments

parties

A vector of parties that make up the diagram

shares

A vector of the parties' member count or proportion of seats in parliament

party_colors

A vector of colors mapped to each party

type

The type of shares passed. Absolute for counts, proportion for proportions. Defaults to absolute

border_color

Border color of the arc. Defaults to black

text_total

Boolean indicator for whether to display the total number of members inside the diagram. Defaults to TRUE

autosort

Sort the parties from most to least members. Defaults to FALSE.

rad_inner

Limiting inner radius of the diagram. Defaults to 1.5

rad_outer

Limiting outer radius of the diagram. Defaults to 3

arc_n

Number of points used to draw arc polygons for each party Defaults to 360

sep

Total spacing between parties as a proportion of pi. Defaults to 0.05

Examples

1
2
3
4
5
6
7
8
# Generate Data
# Generate Data
bt <- data.frame(
        parties = c("CDU", "CSU", "SPD", "AfD", "FDP", "Linke", "Gruene", "Fraktionslos"),
        seats   = c(200, 46, 153, 92, 80, 69, 67, 2),
        colors  = c("black", "blue", "red", "lightblue", "yellow","purple", "green", "grey"),
        stringsAsFactors = FALSE)
ggplot_parliament2(bt$parties, bt$seats, bt$colors, sep = 0.05)

erocoar/ggparl documentation built on May 24, 2019, 8:48 p.m.