sainte_lague | R Documentation |
Originally an algorithm for proportional allocation of seats to parties in elections, used here to assign the six triangles in each hex to classes.
sainte_lague(votes, nseats)
votes |
Vector of 'votes' for each party, non-negative numeric values |
nseats |
Single integer giving the number of seats to be allocated (6, here) |
Numeric vector of length nseats
giving the class membership for each seat, with an error
attribute giving the rounding errors for each party.
https://en.wikipedia.org/wiki/Sainte-Lagu%C3%AB_method
hextri
sainte_lague(c(100,200,300,50),6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.