Calculates number of seats for the respective parties that have received more
than hurdle percent of votes (according to the method of Hare/Niemeyer)
hare_niemeyer(votes, parties, n_seats = 183)A data.frame containing parties above the hurdle and the respective
seats/percentages after redistribution via Hare/Niemeyer
library(coalitions)
library(dplyr)
# get the latest survey for a sample of German federal election polls
surveys <- get_latest(surveys_sample) %>% ungroup() %>% slice(1) %>% tidyr::unnest("survey")
# calculate the seat distribution based on Hare/Niemeyer for a parliament with 300 seats
hare_niemeyer(surveys$votes, surveys$party, n_seats = 300)
#> [1] 114 72 24 24 27 24 15