Although with plurality method each voter is required to mention
only one candidate, a ballot with more than one candidate and
different scores is also valid. For a score matrix, the function will
check the position j which has the lowest score (in a
the lower, the better) in the ith row. Duplicated values may or may
not be a problem. For instance,
c(2, 3, 3) is valid, for the
lowest value is 2 and it is in the 1st position. However,
c(2, 2, 3) is a problem, for the 1st and 2nd positions
all have the lowest value 2. If this problem exists, the winner
returned by this function will be NULL.
an object of class
whether ballots with duplicated score values are taken into account. Default is TRUE.
default is 1. If the number of valid entries of a ballot is less than this value, the ballot will not be used.
a list object.
call the function call.
method the counting method.
candidate candidate names.
candidate_num number of candidate.
ballot_num number of ballots in x.
valid_ballot_num number of ballots that are
used to compute the result.
winner the winners, may be one, more than one or NULL.
absolute whether the winner is of absolute majority.
other_info a list with 2 elements, the 1st is the
frequencies of candidates mentioned as 1st choice; the second element is
the percentage. If winner is NULL, these two are NULL.
1 2 3 4 5 6 7 8 9 10
raw <- rbind( c(1, 2, 5, 3, 3), c(1, 2, 5, 3, 4), c(1, 2, 5, 3, 4), c(NA, NA, NA, NA, NA), c(NA, 3, 5, 1, 2), c(NA, NA, NA, 2, 3), c(NA, NA, 1, 2, 3), c(NA, NA, NA, NA, 2), c(NA, NA, NA, 2, 2), c(NA, NA, 1, 1, 2), c(1, 1, 5, 5, NA) ) vote <- create_vote(raw, xtype = 1) y <- plurality_method(vote, allow_dup = FALSE) y <- plurality_method(vote, allow_dup=FALSE, min_valid = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.