ranks: ranking

Description Usage Arguments Value Examples

View source: R/ranks.R

Description

return ranks that treat tied values either as average or that use the minimum rank and shrink ranks so that the gap between adjacent ranks is always 1

Usage

1
ranks(x, tiestreat = c("avg", "minshrink"))

Arguments

x

numeric, the dominance index

tiestreat

either "average" or "minshrink"

Value

a vector with ranks (the same length as x)

Examples

1
2
3
4
5
6
7
8
x <- c(1, 2, 2, 7, 8)
# maximum rank possible is 5
ranks(x, tiestreat = "avg")
ranks(x, tiestreat = "minshrink")
x <- c(7, 2, 2, 3, 10, 10)
# maximum rank possible is 6
ranks(x, tiestreat = "avg")
ranks(x, tiestreat = "minshrink")

gobbios/radagio documentation built on Dec. 26, 2019, 6:13 p.m.