score | R Documentation |
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.
score(votes, nseats = 1, max.score = NULL, larger.wins = TRUE,
fsep = "\t", quiet = FALSE, ...)
## S3 method for class 'vote.score'
summary(object, ...)
## S3 method for class 'vote.score'
view(object, ...)
votes |
Matrix or data frame containing the votes which should be numbers between 0 and |
nseats |
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 |
quiet |
If |
... |
Not used. |
object |
Object of class |
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. |
Hana Sevcikova, Adrian Raftery
https://en.wikipedia.org/wiki/Range_voting
count.votes
# Example using the IMS Council dataset modified for score voting
data(ims_score)
score.ims <- score(ims_score, max.score = 9)
summary(score.ims)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.