# 5 candidates
candidates = paste0("V", seq_len(5))
# 4 voters
voters = list(
c("V3", "V1", "V4"),
c("V3", "V1"),
c("V3", "V2"),
c("V2", "V4")
)
# voter weights
weights = c(1.1, 2.5, 0.8, 0.9)
# Approval voting (all voters equal)
rank_candidates(voters, candidates)
# Approval voting (voters unequal)
rank_candidates(voters, candidates, weights)
# Satisfaction Approval voting (voters unequal, no borda score)
rank_candidates(voters, candidates, weights, method = "sav", borda_score = FALSE)
# Sequential Proportional Approval voting (voters equal, no borda score)
rank_candidates(voters, candidates, method = "seq_pav", borda_score = FALSE)
# Sequential Phragmen's Rule (voters equal)
rank_candidates(voters, candidates, method = "seq_phragmen", borda_score = FALSE)
Run the code above in your browser using DataLab