Largest Remainder Method

Description

Largest Remainder Method

Usage

allocation(x, m, method, extra = NULL)

Arguments

x a data.frame or tibble with two columns. The first and second column represents names of parties and numbers of votes, respectively.
m a numeric value of district magnitude.
method a character string giving a method for computing seat allocation. See "Allocation methods" section.
extra a numeric vector of length m. If method is “custom divisor” (“cd”) or “custom quota” (“cq”), this parameter is mandatory. See "About custom methods" section.

Value

A tibble object with two columns.

Allocation methods

  • Highest average method

    • “d’hondt” (“dt”) or “jefferson”: D’hondt / Jefferson method

    • “adams” or “cambridge”: Adams / Cambridge method

    • “sainte-lague” (“sl”) or “webster”: Sainte-Laguë / Webster method

    • “modified sainte-lague” (“msl”): Modified Sainte-Laguë method

    • “danish”: Danish method

    • “imperiali”: Imperiali method

    • “hungtington-hill” (“hh”): Huntington-Hill method

    • “dean”: Dean method

    • “ad”: alpha-divergence. extra is mandatory.

    • “custom divisor” (“cd”): Custom divisor. extra is mandatory.

  • Largest reminder method

    • “hare-niemeyer” (“hn” or “hare”): Hare-Niemeyer quota

    • “droop”: Droop quota

    • “hagenbach-bischoff” (“hb”): Hagenbach-Bischoff quota

    • “imperiali quota” (“iq”): Imperiali quota

    • “custom quota” (“cq”): Custom quota. extra is mandatory.

Examples

library("PRcalc")

sample_data <- data.frame(Party = c("Party A", "Party B", "Party C", "Party D"),
                          Votes = c(53000, 25000, 16600, 5400))

sample_data
    Party Votes
1 Party A 53000
2 Party B 25000
3 Party C 16600
4 Party D  5400
# Magnitude = 10, Hare-Niemeyer quota
allocation(x = sample_data, m = 10, method = "hare")
    party votes
1 Party A     5
2 Party B     2
3 Party C     2
4 Party D     1
# Magnitude = 10, D'hondt method
allocation(x = sample_data, m = 10, method = "dt")
# A tibble: 3 × 2
  party   votes
  <chr>   <int>
1 Party A     6
2 Party B     3
3 Party C     1
# Custom divisor: 1.4, 3, 5, 7, ... (identical to Modified Sainte-Laguë method)
allocation(x = sample_data, m = 10, method = "custom divisor",
           extra = c(1.4, seq(3, 19, by = 2)))
# A tibble: 3 × 2
  party   votes
  <chr>   <int>
1 Party A     5
2 Party B     3
3 Party C     2