# Here are some examples of data entry using proportions.
A <- c(.75,.25)
B <- c(.35,.35,.30)
C <- c(.75,.10,rep(0.01,15))
D <- c(.55,rep(.10,3), rep(0.01,15))
E <- c(.15,rep(.15,5),0.1)
# appply
get.enp(seats=A, votes=NULL, total=1)
get.enp(seats=A, votes=NULL, 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)
seats10 = c(88,79,53,43,41,41,34,28,21,17,15,15,12,8,4,3,3,2,2,2,1,1)/513
get.enp(seats=seats10, votes=NULL, total=NULL, method="Golosov")
# 2014 Election outcome
seats14 = 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
get.enp(seats=seats14, votes=NULL, total=NULL, method="Golosov")
Run the code above in your browser using DataLab