# Example using the IMS Council dataset modified for approval voting
data(ims_approval)
approval(ims_approval) # Li wins
# Increase the weight of voters who did not vote for Li
weighted.approval <- cbind(ims_approval, weight = 1)
weighted.approval$weight[ims_approval$Li == 0] <- 2
approval(weighted.approval, weight.column = "weight") # now Jasper wins
# Example using the IMS Council dataset modified for plurality voting
data(ims_plurality)
pl.ims <- plurality(ims_plurality)
invalid.votes(pl.ims)
# Can we get Wang to win by increasing the weight of its votes?
weighted.plurality <- cbind(ims_plurality, weight = 1)
weighted.plurality$weight[ims_plurality$Wang == 1] <- 10
plurality(weighted.plurality, weight.column = "weight") # now Wang wins
Run the code above in your browser using DataLab