Arc_Parlamentario {Relectoral} | R Documentation |
Graphs. Representation of Parliamentary Arc
Description
This function facilitates the representation of the distribution of seats obtained by each of the parties that have some parliamentary representation. It can be introduced a title for the graph, the colors to be used for each party, as well as to choose whether to make a distribution of seats in absolute or relative terms.
Usage
Arc_Parlamentario(
Partidos,
Escanos,
cols = NULL,
repr = c("absolute", "proportion"),
titulo = "Enter a title here"
)
Arguments
Partidos |
It is a string vector containing the name of the parties. |
Escanos |
It is a vector of natural numbers containing the seats that have been allocated to each party. |
cols |
(Optional) It is a vector containing the colors to be used to draw each zone of the parliamentary arc. |
repr |
It must contain the expression "absolute" or "Proportion" to perform the representation based on absolute or relative terms respectively. |
titulo |
To provide the title to be placed on the chart |
Value
Returns a ggplot object, containing the representation of the obtained parliamentary arc.
Examples
bt <- data.frame(parties = c("PP", "CSU", "SPD", "AfD", "FDP", "UPyD", "CC", "Verdes"),
seats = c(200, 46, 153, 92, 80, 69, 67, 2),
cols = c("black", "blue", "red", "lightblue", "yellow", "purple", "lavenderblush", "grey"),
stringsAsFactors = FALSE)
Arc_Parlamentario(bt$parties, bt$seats, cols = bt$cols)