gauges: Gauges

Description Usage Arguments Value Examples

View source: R/HighestMedianRules.R

Description

Aggregator of 'gauge': returns the gauge of each row (i.e. candidate) from a matrix (i.e. the voting profile). See function 'gauge'.

Usage

1
gauges(grades, k = 0.5, scale = c(), return = "qp")

Arguments

grades

A numeric vector containing the shares of each grades of a candidate, from the lowest grade to the highest.

k

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).

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))).

return

A string containing the information to return. Default to 'qp' (shares of opponents and proponents). Possible values: 'g', 'p', 'q', 'pq', 'qp', 'qpg', 'pqg', 'gpq', 'gqp', 'text' (i.e. the gauge), 'all'. If the string does not match one of the above, 'all' is returned.

Value

An array with as many columns as elements of grades, with the return of gauge in each column.

Examples

1
gauges(grades = elec2012, return = 'gqp')

HighestMedianRules documentation built on March 26, 2020, 7:28 p.m.