The main function of the package is called count.votes
. If no specific method is passed, it decides on the basis of the available data which method is the most appropriate. Specific methods can also be invoked explicitly.
The following voting methods are available:
stv: Single transferable vote (STV) where voters rank candidates in order. It is also known as ranked choice voting or or instant runoff.
score: Range voting where each voter gives each candidate a
score within a specific range.
approval: Voters give each candidate one (approve) or zero (not approve).
plurality: Each voter chooses one candidate.
Output of these functions can be viewed using summary
methods, or in a browser using view
methods. The summary
methods return a data frame which can be stored in a file, see Example below. Functions invalid.votes
and valid.votes
can be used to check the validity of ballots for the various methods.
Example datasets are included. The ims_election
dataset contains anonymized ballots from a past Council election of the Institute of Mathematical Statistics (IMS) which uses the STV method. Modifications of this dataset are available (ims_approval
, ims_score
, ims_plurality
) as examples of data required by the various methods. The food_election
dataset taken from Wikipedia can be used to test the STV method.