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.

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().

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.

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.

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))
#>   Z1 Z2
#> A 40 12
#> B  5  8
#> C  5  0
#> D  0  0

biproporz(votes_matrix, seats, quorum = quorum_all(any_district = 0.1, total = 100))
#>   Z1 Z2
#> A 44 12
#> B  6  8
#> C  0  0
#> D  0  0

biproporz(votes_matrix, seats, quorum = quorum_any(any_district = 0.1))
#>   Z1 Z2
#> A 40 12
#> B  5  8
#> C  5  0
#> D  0  0

biproporz(votes_matrix, seats, quorum = quorum_any(total = 100))
#>   Z1 Z2
#> A 44 12
#> B  6  8
#> C  0  0
#> D  0  0

biproporz(votes_matrix, seats, quorum = quorum_any(total = 0.5))
#>   Z1 Z2
#> A 50 20
#> B  0  0
#> C  0  0
#> D  0  0

# the quorum parameter also accepts vectors (e.g. calculated elsewhere)
biproporz(votes_matrix, seats, quorum = c(FALSE, TRUE, TRUE, TRUE))
#>   Z1 Z2
#> A  0  0
#> B 27 20
#> C 20  0
#> D  3  0