score: Score Vote Count

Description Usage Arguments Value Author(s) References See Also Examples

Description

Count votes using the score (or range) method. Voters give each candidate a score, the scores are added and the candidate(s) with the highest (or lowest) totals is/are elected.

Usage

1
2
3
4
5
6
7
score(votes, mcan = 1, max.score = NULL, larger.wins = TRUE, fsep = "\t", ...)

## S3 method for class 'vote.score'
summary(object, ...)

## S3 method for class 'vote.score'
view(object, ...)

Arguments

votes

Matrix or data frame containing the votes which should be numbers between 0 and max.score. Rows correspond to the votes, columns correspond to the candidates. If it is a character string it is interpreted as a tab-separated file name from which the votes are to be read. Missing values (NA) are interpreted as zeros.

mcan

Number of candidates to be elected.

max.score

Maximum score allowed. It is used to remove invalid votes. If not given, the maximum value contained in the data is taken and thus, all non-negative votes are valid.

larger.wins

Logical argument indicating whether the winners are the candidates with the highest scores (default) or the lowest scores.

fsep

If votes is a file name, this argument gives the column separator in the file.

...

Not used.

object

Object of class vote.score.

Value

Function score returns an object of class vote.score which is a list with the following objects:

elected

Vector of names of the elected candidates in the order in which they were elected.

totals

Vector of total votes in the same order as candidates (columns) in the input data.

larger.wins

Input argument of the same name.

data

Input data with invalid votes removed.

invalid.votes

Number of invalid votes that were removed from the original dataset.

Author(s)

Hana Sevcikova, Adrian Raftery

References

https://en.wikipedia.org/wiki/Range_voting

See Also

count.votes

Examples

1
2
3
4
# Example using the IMS Council dataset modified for score voting
data(ims_score)
score.ims <- score(ims_score, max.score = 9)
summary(score.ims)

vote documentation built on May 2, 2019, 1:09 p.m.