Proportional Apportionment

Proportional apportionment distributes seats for a vector of votes. With proporz(), all divisor or largest remainder methods can be accessed.

proporz()

Proportional apportionment

Divisor Methods

highest_averages_method()

Highest averages method

divisor_round() divisor_floor() divisor_harmonic() divisor_geometric() divisor_ceiling()

Divisor methods

Largest Remainder Method

largest_remainder_method()

Largest remainder method

Biproportional Apportionment

Biproportional apportionment distributes seats for a matrix of votes among parties and districts.

biproporz()

Biproportional apportionment

pukelsheim()

Biproportional apportionment with data frames

Algorithm implementations

upper_apportionment()

Calculate upper apportionment

lower_apportionment()

Calculate lower apportionment

Quorum calculations

quorum_all() quorum_any()

Create quorum functions for biproportional apportionment

reached_quorum_any_district()

Check if lists/parties have reached a quorum in at least one district

reached_quorum_total()

Check if lists/parties have reached the quorum for all votes

Shiny App

run_app()

Use biproportional apportionment interactively in a shiny app

Example Datasets

zug2018

Election Data for the Cantonal Council of Zug (2018)

uri2020

Election Data for the Cantonal Council of Uri (2020)

finland2019

Finnish Parliamentary Elections Data (2019)

Helpers

get_divisors()

Get district and party divisors from biproporz result

pivot_to_matrix() pivot_to_df()

Pivot long data.frame to wide matrix and vice versa

ceil_at()

Rounding with predefined thresholds

weight_list_votes()

Create weighted votes matrix