# Example: 2014 Brazilian election for the lower house in
# the state of Ceara. Coalitions were leading by the
# following parties:
results <- c(DEM=490205, PMDB=1151547, PRB=2449440,
PSB=48274, PSTU=54403, PTC=173151)
dHondt(parties=names(results), votes=results, seats=19)
# The next example is 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")
dHondt(parties, votes , seats=42)
Run the code above in your browser using DataLab