Learn R Programming

proporz (version 1.5.3)

find_divisor: Find divisor to assign seats

Description

Find a divisor between divisor_from and divisor_to such that sum(round_func(votes/divisor)) equals target_seats

Usage

find_divisor(votes, divisor_from, divisor_to, target_seats, round_func)

Value

divisor (single number)

Arguments

votes

Votes (matrix with only one column or row, allows to use row/colnames within round_func)

divisor_from

Lower bound for divisor search range (is decreased if necessary)

divisor_to

Upper bound for divisor search range (is increased if necessary)

target_seats

Number of seats to distribute (single number)

round_func

Rounding function