seats_dhont: Compute D'Hondt rule to assign seats

View source: R/ana_elections_seats.R

seats_dhontR Documentation

Compute D'Hondt rule to assign seats

Description

This function computes the seats in election data.

Usage

seats_dhont(df, party, votes, seats, blanks = 0, barrier = 0)

Arguments

party

Character. Name of the column for parties.

votes

Character. Name of the columns with the number of votes.

seats

Numeric. Number of seats to be assigned.

blanks

Numeric. Number of blank votes in the circunscription. Default is zero.

barrier

Numeric. Vote percentage for electoral barrier. Default is zero.

data

Data frame. Input data frame with two columns party and votes.

Value

A data frame with three columns party, votes and seats.


pablocal/pablo documentation built on June 14, 2024, 12:16 p.m.