rank_numeric {gosset} | R Documentation |
Plackett-Luce rankings from numeric values
Description
Group and coerce numeric values into Plackett-Luce rankings.
Usage
rank_numeric(
data,
items,
input,
id = NULL,
group = FALSE,
ascending = FALSE,
...
)
Arguments
data |
a data.frame with columns specified by items and input values |
items |
a character or numerical vector for indexing the column(s)
containing the item names in |
input |
a character or numerical vector for indexing the column(s)
containing the values in |
id |
an index of |
group |
logical, if |
ascending |
logical, only for floating point numbers, to compute rankings from lower to higher values |
... |
additional arguments passed to methods |
Value
a PlackettLuce "rankings" object, which is a matrix of dense rankings
Author(s)
KauĂȘ de Sousa
See Also
Other rank functions:
rank_tricot()
,
set_binomialfreq()
,
set_paircomp()
Examples
# A matrix with 10 rankings of 5 items (A, B, C, D, E)
# with numeric values as "rank"
set.seed(123)
df = cbind(id = rep(1:10, each = 5),
items = rep(LETTERS[1:5], times = 10),
input = runif(50, 1, 3))
# return an object of class 'rankings'
R = rank_numeric(df,
items = 2,
input = 3,
id = 1)
# rankings can be computed in ascending order
R = rank_numeric(df,
items = 2,
input = 3,
id = 1,
ascending = TRUE)
# return an object of class 'grouped_rankings'
R = rank_numeric(df,
items = 2,
input = 3,
id = 1,
group = TRUE)
[Package gosset version 1.3 Index]