# Zug 2018
votes_df = unique(zug2018[c("list_id", "entity_id", "list_votes")])
district_seats_df = unique(zug2018[c("entity_id", "election_mandates")])
seats_df = pukelsheim(votes_df,
district_seats_df,
quorum_any(any_district = 0.05, total = 0.03),
winner_take_one = TRUE)
head(seats_df)
# Finland 2019
finland19_result = pukelsheim(finland2019$votes_df,
finland2019$district_seats_df,
new_seats_col = "mandates",
use_list_votes = FALSE)
tail(finland19_result[order(finland19_result$mandates),])
Run the code above in your browser using DataLab