Learn R Programming

proporz (version 1.5.1)

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

Arguments

votes

votes (matrix with only one column or vector, 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