rrace.RdReturns a rank vector suitable for interpretation with race().
rrace(strengths)Uses a simple recursive system to generate the ranks.
Returns a character vector with entries corresponding to the competitor. The first element is the winner, the second the runner-up, and so on, until the final element is the last to cross the finishing line.
o <- c(a=0.4, b=0.3, c=0.2, d=0.1)
rrace(o)
#> [1] "a" "b" "d" "c"
suppfun(rrace(o))
#> log( a * (a + b + c + d)^-1 * (a + c + d)^-1 * b * (c + d)^-1 * d)
as.ranktable(t(replicate(10, rrace(o)))) # same as rrank(10,o)
#> A ranktable:
#> c1 c2 c3 c4
#> [1,] a b c d
#> [2,] d b a c
#> [3,] b c a d
#> [4,] a d b c
#> [5,] a d c b
#> [6,] d b a c
#> [7,] b a c d
#> [8,] c a b d
#> [9,] b a c d
#> [10,] c b a d