Learn R Programming

coalitions (version 0.6.12)

dHondt: Seat Distribution by D'Hondt

Description

Calculates number of seats for the respective parties that have received more than hurdle percent of votes (according to the method of D'Hondt)

Usage

dHondt(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 D'Hondt

See Also

sls

Examples

Run this code
# NOT RUN {
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 D'Hondt for a parliament with 300 seats
dHondt(surveys$votes, surveys$party, n_seats = 300)
# }

Run the code above in your browser using DataLab