library(proporz)
df_votes = structure(
list(list_id = c("SDP", "PS", "KOK", "PS", "KOK", "SDP", "KOK", "SDP", "PS"),
entity_id = c("HEL", "UUS", "HAEM", "HEL", "UUS", "HAEM", "HEL", "UUS", "HAEM"),
list_votes = c(4000, 9000, 17000, 23000, 29500, 36000, 42500, 49000, 17999)),
row.names = c(NA, -9L), class = "data.frame")
df_district_seats = structure(
list(entity_id = c("HEL", "UUS", "HAEM"),
election_mandates = c(5, 10, 15)),
row.names = c(NA, -3L), class = "data.frame")
pukelsheim(df_votes, df_district_seats)
#> Error in bisect(fun, divisor_range[1], divisor_range[2], tol):
#> (f(x1) <= 0 & f(x2) >= 0) | (f(x1) >= 0 & f(x2) <= 0) is not TRUE