hare_niemeyer: Seat Distribution by Hare/Niemeyer

View source: R/hare_niemeyer.R

hare_niemeyerR Documentation

Seat Distribution by Hare/Niemeyer

Description

Calculates number of seats for the respective parties that have received more than hurdle percent of votes (according to the method of Hare/Niemeyer)

Usage

hare_niemeyer(votes, parties, n_seats = 183)

Arguments

votes

Number of votes per party.

parties

Names of parties (must be same length as votes).

n_seats

Number of seats in parliament. Defaults to 183 (seats in Austrian parliament).

Value

A data.frame containing parties above the hurdle and the respective seats/percentages after redistribution via Hare/Niemeyer

See Also

sls

Examples

library(coalitions)
library(dplyr)
# get the latest survey for a sample of German federal election polls
surveys <- get_latest(surveys_sample) %>% 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)

coalitions documentation built on Aug. 17, 2022, 5:07 p.m.