quorum_functions {proporz}R Documentation

Create quorum functions for biproportional apportionment

Description

quorum_any() and quorum_all() are used for the quorum parameter in biproporz() or pukelsheim() and help describe how quorums should be applied previous to seat distributions.

Usage

quorum_all(any_district, total)

quorum_any(any_district, total)

Arguments

any_district

Vote threshold a party must reach in at least one district. Used as share of total votes within a district if less than 1 otherwise as number of votes. Must be greater than 0. Uses reached_quorum_any_district().

total

Vote threshold a party must reach for all votes cast. Used as share of total votes if less than 1, otherwise as number of votes. Must be greater than 0. Uses reached_quorum_total().

Details

There's a difference in how the functions work. With quroum_any, at least one quorum must be reached. With quorum_all all (i.e. both) quorums must be reached. If you only use one parameter, quorum_any() and quorum_all() are identical.

Value

a function which, when called with ⁠function(votes_matrix)⁠, returns a boolean vector with length equal to the number of lists/parties (votes_matrix rows). The vector shows whether a party has reached any/all quorums.

Examples

votes_matrix = matrix(c(502, 55, 80, 10, 104, 55, 0, 1), ncol = 2)
dimnames(votes_matrix) <- list(c("A", "B", "C", "D"), c("Z1", "Z2"))
seats = c(Z1 = 50, Z2 = 20)

# use as parameter in biproporz or pukelsheim (general use case)
biproporz(votes_matrix, seats, quorum = quorum_any(any_district = 0.1, total = 100))

biproporz(votes_matrix, seats, quorum = quorum_all(any_district = 0.1, total = 100))

biproporz(votes_matrix, seats, quorum = quorum_any(any_district = 0.1))

biproporz(votes_matrix, seats, quorum = quorum_any(total = 100))

biproporz(votes_matrix, seats, quorum = quorum_any(total = 0.5))

# the quorum parameter also accepts vectors (e.g. calculated elsewhere)
biproporz(votes_matrix, seats, quorum = c(FALSE, TRUE, TRUE, TRUE))


[Package proporz version 1.5.0 Index]