Calculate seat apportionment for legislative bodies.
proporz(votes, n_seats, method, quorum = 0)
numeric vector with number of votes for each party
total number of seats
Apportionment method to use, as character. Not case sensitive. See details.
Vote threshold a party must reach. Used as quota of total votes within a district if less than 1 otherwise as number of votes.
The number of seats per party as a vector
The following methods are available:
d'hondt, jefferson, hagenbach-bischoff, floor: use divisor_floor()
sainte-lague, webster, round: use divisor_round()
adams, ceiling: use divisor_ceiling()
dean, harmonic: use divisor_harmonic()
huntington-hill, hill-huntington, geometric: use divisor_geometric()
hare-niemeyer, hamilton, vinton, largest_remainder_method: use largest_remainder_method()
Seats can also be apportioned among regions instead of parties. The
parameter votes
is then normally used with census data (e.g.
population counts).
votes = c("Party A" = 651, "Party B" = 349, "Party C" = 50)
proporz(votes, 10, "sainte-lague")
#> Party A Party B Party C
#> 7 3 0
proporz(votes, 10, "hill-huntington")
#> Party A Party B Party C
#> 6 3 1
proporz(votes, 10, "hill-huntington", quorum = 0.05)
#> Party A Party B Party C
#> 6 4 0
proporz(votes, 10, "jefferson", quorum = 70)
#> Party A Party B Party C
#> 7 3 0