divisorMethods: Divisor Methods

Description Usage Arguments Value Examples

Description

Allocate seats to parties using a variaty of divisor methods.

Usage

1
2
3
divisorMethods(parties = NULL, votes = NULL, seats = NULL,
  method = c("dh", "sl", "msl", "danish", "hsl", "hh", "imperiali", "wb",
  "jef", "ad", "hb"), threshold = 0, order_name = TRUE, ...)

Arguments

parties

A character vector for party labels in the same order as in the numerical vector of votes for parties. If NULL, 3-letter identifiers (e.g. 'XYZ') will be assigned.

votes

A numeric vector of votes received by each party.

seats

The number of seats to be apportioned.

method

A character name for the method to be used (e.g. 'dh' = d'Hondt). The following apportionment methods are available: "dh" - d'Hondt method, "sl" - Sainte-Lague method, "msl" - Modified Sainte-Lague method, "danish" - Danish modified Sainte-Lague method, "hsl" - Hungarian modified Sainte-Lague method, "imperiali" - The Italian Imperiali (not to be confused with the Imperiali Quota, which is a Largest remainder method), "hh" - Huntington-Hill method, "wb" - Webster's method, "jef" - Jefferson's method, "ad" - Adams's method, "hb" - Hagenbach-Bischoff method.

threshold

A numeric value between [0, 1]. Default is set to 0.

order_name

A logical value. Sort rows of a dataframe with results by party name (alphabetically).

Value

A data.frame of length parties containing apportioned seats.

Examples

1
(...)

pierzgal/disprr documentation built on May 25, 2019, 7:11 a.m.