View source: R/divisor_methods.R
highest_averages_method | R Documentation |
Allocate seats proportionally for divisor methods
.
highest_averages_method(votes, n_seats, divisors)
votes |
numeric vector with number of votes for each party |
n_seats |
total number of seats |
divisors |
sequence of divisors (length equal to the number of seats). If it is a single number (e.g. 0.5), a sequence is generated starting with it. |
The highest averages method requires the number of votes for each party to be divided successively by a series of divisors. This produces a table of quotients, or averages, with a row for each divisor and a column for each party. The nth seat is allocated to the party whose column contains the nth largest entry in this table, up to the total number of seats available. (Wikipedia)
The number of seats per party as a vector
highest_averages_method(c(5200, 1700, 3100), 15, 0.5)
highest_averages_method(votes = c(50, 0, 30), n_seats = 3,
divisors = c(0, 1.3333, 2.4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.