Description Usage Arguments Value Examples
View source: R/Arco_parlamentario.R
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.
1 2 3 4 5 6 7  | Arc_Parlamentario(
  Partidos,
  Escanos,
  cols = NULL,
  repr = c("absolute", "proportion"),
  titulo = "Enter a title here"
)
 | 
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  | 
Returns a ggplot object, containing the representation of the obtained parliamentary arc.
1 2 3 4 5 6  | 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)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.