Learn R Programming

hextri (version 0.9.17)

sainte_lague: Proportional representation by Sainte-Lague method

Description

Originally an algorithm for proportional allocation of seats to parties in elections, used here to assign the six triangles in each hex to classes.

Usage

sainte_lague(votes, nseats)

Arguments

votes

Vector of 'votes' for each party, non-negative numeric values

nseats

Single integer giving the number of seats to be allocated (6, here)

Value

Numeric vector of length nseats giving the class membership for each seat, with an error attribute giving the rounding errors for each party.

References

https://en.wikipedia.org/wiki/Sainte-Lagu%C3%AB_method

See Also

hextri

Examples

Run this code
# NOT RUN {
sainte_lague(c(100,200,300,50),6)
# }

Run the code above in your browser using DataLab