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))
Run the code above in your browser using DataLab