rankings {HighestMedianRules} | R Documentation |
Rankings
Description
Returns a matrix with the scores of candidates sorted in decreasing order of score mj, for the five following voting rules (with k=0.5): mj, d, s, n, mean. See function 'score' for more details.
Usage
rankings(
grades,
scale = c(),
names = row.names(grades),
return_distance = FALSE,
rounds = TRUE
)
Arguments
grades |
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. |
scale |
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))). |
names |
String vector, each string to be printed in case print = TRUE. Defaults to c(). |
return_distance |
If TRUE, returns the Kendall distance between the rules (using AllKendall) instead of the matrix of scores. Default to FALSE. |
rounds |
If TRUE, rounds the scores (to 3 digits for highest median rules and 2 digits for range voting). Default to TRUE. |
Value
A character matrix with as many rows as elements of grades
, and with the name, gauge and scores (according to five different rules) on each row.
Examples
rankings(elec2012, scale=-2:4)