Learn R Programming

electoral

The goal of electoral package is provide simple functions to compute allocating seats methods and party system scores

Implemented allocating seats methods are:

For highest averages group: D'Hondt, Webster, Danish, Imperiali, Hill-Huntington, Dean, Modified Sainte-Lague, Equal proportions and Adams.

For largest remainders group: Hare, Droop, Hangenbach-Bischoff, Imperial, Modified Imperial, Quotas&Remainders.

Developed party system scores are:

Competitiveness, concentration, effective number of parties (ENP), party nationalization score (PNS), party system nationalization score (PSNS) and volatility. Effective number of parties implemented methods are Laakso-Taagepera and Golosov. Available party nationalization score and party system nationalization score methods are Jones-Mainwaring and Golosov.

Installation

You can install electoral directly from CRAN:

install.packages("electoral")

Or install it from GitHub with:

if (!require("devtools")) {
  install.packages("devtools")
  library("devtools")
}
devtools::install_github("albuja/electoral")

Examples

This is a basic example which shows you how to allocate seats by two common methods (D'Hondt and Hare):

library(electoral)

seats(parties = c("A", "B", "C"),
       votes = c(100, 150, 60),
       n_seats = 5,
       method = "dhondt")

seats(parties = c("A", "B", "C"),
       votes = c(100, 150, 60),
       n_seats = 5,
       method = "hare")

This is a basic example which shows you how to compute effective number of parties using Laakso-Taagepera method:

library(electoral)

enp(votes = c(100, 150, 60))

Copy Link

Version

Install

install.packages('electoral')

Monthly Downloads

315

Version

0.1.4

License

GPL-3

Maintainer

Jorge Albuja

Last Published

May 1st, 2025

Functions in electoral (0.1.4)

seats_ha

Allocating Seats - Highest Averages
concentration

Electoral Concentration
volatility

Electoral Volatility
competitiveness

Electoral Competitiveness
psns

Party System Nationalization Score (PSNS)
seats

Allocating Seats by any method
seats_lr

Allocating Seats - Largest Remainders
pns

Party Nationalization Score (PNS)
enp

Effective Number of Parties (ENP)