Description Usage Arguments Value Note Author(s) References See Also Examples
The function calculates seats allotment in legislative house, given the total number of seats and the votes for each party based on the Victor D'Hondt's method (1878). The D'Hondt's method is mathematically equivalent to the method proposed by Thomas Jefferson few years before (1792).
1 2 3 |
parties |
a vector containig parties labels or candidates accordingly to the |
votes |
a vector containing the total number of formal votes received by the parties/candidates. |
seats |
an integer for the number of seats to be filled (the district magnitude). |
... |
Additional arguements (currently ignored) |
A data.frame
of length parties
containing apportioned integers (seats) summing to seats
.
Adapted from Carlos Bellosta's replies in the R-list.
Daniel Marcelino, dmarcelino@live.com.
Lijphart, Arend (1994). Electoral Systems and Party Systems: A Study of Twenty-Seven Democracies, 1945-1990. Oxford University Press.
HighestAverages
, LargestRemainders
, Hamilton
, PoliticalDiversity
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | votes <- sample(1:10000, 5)
parties <- sample(LETTERS, 5)
dHondt(parties, votes, seats = 4)
# Example: 2014 Brazilian election for the lower house in
# the state of Ceara. Coalitions were leading by the
# following parties:
results <- c(DEM=490205, PMDB=1151547, PRB=2449440,
PSB=48274, PSTU=54403, PTC=173151)
dHondt(parties=names(results), votes=results, seats=19)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.