| cdc_simple {votesys} | R Documentation |
Ordinary Condorcet Method
Description
Candidates enter into pairwise comparison. if the number of voters who prefer a is larger than the number of voters who prefer b, then a wins b, a gets 1 point, b gets 0 point. If the numbers are equal, then both of them gets 0 point. Suppose there are n candidates, the one gets n-1 points wins (that is, he wins in all pairwise comparison). There may be no Condorcet winner. If thus, you can try other Condorcet family methods.
Usage
cdc_simple(x, allow_dup = TRUE, min_valid = 1)
Arguments
x |
it accepts the following types of input:
1st, it can be an object of class |
allow_dup |
whether ballots with duplicated score values are taken into account. Default is TRUE. |
min_valid |
default is 1. If the number of valid entries of a ballot is less than this value, it will not be used. |
Value
a condorcet object, which is essentially
a list.
(1)
callthe function call.(2)
methodthe counting method.(3)
candidatecandidate names.(4)
candidate_numnumber of candidate.(5)
ballot_numnumber of ballots inx. When x is not avoteobject, it may be NULL.(6)
valid_ballot_numnumber of ballots that are actually used to compute the result. When x is not avoteobject, it may be NULL.(7)
winnerthe winner; may be NULL.(8)
input_objectthe class ofx.(9)
cdcthe Condorcet matrix which is actually used.(10)
difthe score difference matrix. When x is not avoteobject, it may be NULL.(11)
binarywin and loss recorded with 1 (win), 0 (equal) and -1 (loss).(12)
summary_mtimes of win (1), equal (0) and loss (-1).(13)
other_infocurrently nothing.
Examples
raw <- c(
rep(c('m', 'n', 'c', 'k'), 42), rep(c('n', 'c', 'k', 'm'), 26),
rep(c('c', 'k', 'n', 'm'), 15), rep(c('k', 'c', 'n', 'm'), 17)
)
raw <- matrix(raw, ncol = 4, byrow = TRUE)
vote <- create_vote(raw, xtype = 2, candidate = c('m', 'n', 'k', 'c'))
win1 <- cdc_simple(vote) # winner is n
win2 <- cdc_simple(win1$cdc) # use a Condorceit matrix
win2 <- cdc_simple(win1) # use an existent result