# Here are some examples help yourself:
A <- c(.75,.25)
B <- c(.35,.35,.30)
C <- c(.75,.10,rep(0.01,15))
ENPs(seats=A, total=1)
ENPs(seats=B, total=1, method="Golosov")
# Non-trivial example:
# 2010 Election outcome
party = c("PT","PMDB","PSDB", "DEM","PR","PP","PSB","PDT","PTB", "PSC","PV",
"PC do B","PPS","PRB", "PMN", "PT do B", "PSOL","PHS","PRTB","PRP","PSL","PTC")
votes = c(13813587, 11692384, 9421347, 6932420, 7050274, 5987670, 6553345,
4478736, 3808646, 2981714,2886633, 2545279, 2376475, 1659973, 1026220,
605768, 968475, 719611, 283047, 232530, 457490, 563145)
# 2010 Election outcome passed as proportion of seats
seats_2010 = c(88, 79, 53, 43, 41, 41, 34, 28, 21,
17, 15, 15, 12, 8, 4, 3, 3, 2, 2, 2, 1, 1)/513
ENPs(seats=seats_2010, total=NULL, method="Golosov")
# 2014 Election outcome passed as proportion of seats
seats_2014 = c(70, 66, 55, 37, 38, 34, 34, 26, 22, 20, 19, 15, 12,
11, 10, 9, 8, 5, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1)/513
ENPs(seats_2014, method="Golosov")
Run the code above in your browser using DataLab