
highestAverages(parties = NULL, votes = NULL, seats = NULL,
method = c("dh", "sl", "msl", "danish", "hsl", "hh", "imperiali", "wb",
"jef", "ad", "hb"), threshold = 0, ...)## S3 method for class 'default':
highestAverages(parties = NULL, votes = NULL,
seats = NULL, method = c("dh", "sl", "msl", "danish", "hsl", "hh",
"imperiali", "wb", "jef", "ad", "hb"), threshold = 0, ...)
votes
. If NULL
, alphabet will be assigned.data.frame
of length parties
containing apportioned integers (seats) summing to seats
.Lijphart, Arend (1994). Electoral Systems and Party Systems: A Study of Twenty-Seven Democracies, 1945-1990. Oxford University Press.
largestRemainders
, dHondt
, hamilton
, politicalDiversity
. For more details see the Indices vignette: vignette('Indices', package = 'SciencesPo')
.# Results for the state legislative house of Ceara (2014):
votes <- c(187906, 326841, 132531, 981096, 2043217, 15061, 103679,109830, 213988, 67145, 278267)
parties <- c("PCdoB", "PDT", "PEN", "PMDB", "PRB", "PSB", "PSC", "PSTU", "PTdoB", "PTC", "PTN")
highestAverages(parties, votes, seats = 42, method = "dh")
# Let's create a data.frame with typical election results
# with the following parties and votes to return 10 seats:
my_election <- data.frame(
party=c("Yellow", "White", "Red", "Green", "Blue", "Pink"),
votes=c(47000, 16000, 15900, 12000, 6000, 3100))
highestAverages(my_election$party,
my_election$votes,
seats = 10,
method="dh")
# How this compares to the Sainte-Lague Method
(dat= highestAverages(my_election$party,
my_election$votes,
seats = 10,
method="sl"))
# Plot it
bar.plot(data=dat, "Party", "Seats") +
theme_fte()
Run the code above in your browser using DataLab