Aggregator of scores: returns a vector with the score of each row (i.e. candidate) in a matrix (i.e. the voting profile). See function 'score'.
aggregate_scores(
grades,
rule = "mj",
k = 0.5,
scale = c(),
names = row.names(grades),
print = FALSE,
return_text = FALSE,
rounds = 3
)A voting profile, i.e. a matrix with the shares of grades of each candidate on each row, from the lowest grade to the highest.
The voting rule to be used. Default to 'mj'. Possible values: 'mj' (majority judgment), 'd' (difference), 's' (relative share), 'n' (normalized difference), 'mean' (range voting). For more details, see "Tie-Breaking the Highest Median", Fabre, Social Choice & Welfare (forthcoming).
The quantile used to compute the gauge. Default to 0.5 (the median). For more details, see paragraph Extensions in 3.2.1 of "Tie-Breaking the Highest Median", Fabre, Social Choice & Welfare (forthcoming).
A numeric vector containing the values of the scale of grades. Default to c((floor(-length(grades)/2)+1):(length(grades)+floor(-length(grades)/2))).
String vector, each string to be printed along the gauges in case print = TRUE and return_text = FALSE. Defaults to "".
Prints the gauges and the argument 'names'. Default to FALSE
Prints the gauges. Defaults to FALSE.
Number of rounding digits. Default to 3.
A double vector or a character vector. The scores (double) if return_text = FALSE, the gauges (character) otherwise.
# NOT RUN {
aggregate_scores(elec2012, rule='d', scale=-2:4)
# }
Run the code above in your browser using DataLab