seats | R Documentation |
This function is a wrapper for seats_ha and seats_lr functions. A shortcut to allocate seats by any method selected by its string name.
Developed by Jorge Albuja Delgado (albuja@yahoo.com).
seats(parties, votes, n_seats, method)
parties |
vector of names of parties, must be uniques |
votes |
vector of votes, same length as parties. |
n_seats |
number of seats to be allocated (integer equal or greater 1). |
method |
string according seat allocating method: "dhondt", "webster", "danish", "imperiali", "hill-huntington", "dean", "mod-saint-lague", "equal-proportions", "adams", "hare", "droop", "hangenbach-bischoff", "imperial", "mod-imperial" or "quotas-remainders". |
A tibble
seats(parties = c("A", "B", "C"), votes = c(100, 150, 60), n_seats = 5, method = "hare") seats(parties = c("V", "W", "X", "Y", "Z"), votes = c(100, 150, 60, 80, 160), n_seats = 15, method = "droop") seats(parties = c("A", "B", "C"), votes = c(100, 150, 60), n_seats = 5, method = "dhondt") seats(parties = c("V", "W", "X", "Y", "Z"), votes = c(100, 150, 60, 80, 160), n_seats = 15, method = "webster")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.