Learn R Programming

SciencesPo (version 1.3.9)

largestRemainders: Largest Remainders Methods of Allocating Seats Proportionally

Description

Computes the largest remainders method for a variety of formulas of allocating seats proportionally.

Usage

largestRemainders(parties = NULL, votes = NULL, seats = NULL,
  method = c("dh", "sl", "msl", "danish", "hsl", "hh", "imperiali", "wb",
  "jef", "ad", "hb"), threshold = 0, ...)

## S3 method for class 'default': largestRemainders(parties = NULL, votes = NULL, seats = NULL, method = c("dh", "sl", "msl", "danish", "hsl", "hh", "imperiali", "wb", "jef", "ad", "hb"), threshold = 0, ...)

Arguments

parties
A character vector for parties labels or candidates in the order as votes. If NULL, a random combination of letters will be assigned.
votes
A numeric vector for the number of formal votes received by each party or candidate.
seats
The number of seats to be filled (scalar or vector).
method
A character name for the method to be used. See details.
threshold
A numeric value between (0~1). Default is set to 0.
...
Additional arguements (currently ignored)

Value

  • A data.frame of length parties containing apportioned integers (seats) summing to seats.

encoding

latin1

Details

The following methods are available:
  • "dh"
{d'Hondt method} "sl"{Sainte-Lague method}

References

Gallagher, Michael (1992). "Comparing Proportional Representation Electoral Systems: Quotas, Thresholds, Paradoxes and Majorities". British Journal of Political Science, 22, 4, 469-496.

Lijphart, Arend (1994). Electoral Systems and Party Systems: A Study of Twenty-Seven Democracies, 1945-1990. Oxford University Press.

See Also

highestAverages, dHondt, hamilton, politicalDiversity. For more details see the Indices vignette: vignette('Indices', package = 'SciencesPo').

Examples

Run this code
# Let's create a data.frame with typical election results
# with the following parties and votes to return 10 seats:

my_election <- data.frame(
party=c("Yellow", "White", "Red", "Green", "Blue", "Pink"),
votes=c(47000, 16000,	15900,	12000,	6000,	3100))

largestRemainders(my_election$party,
my_election$votes, seats = 10,  method="droop")

Run the code above in your browser using DataLab