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] "d" "b" "a" "c"
suppfun(rrace(o))
#> log( a * (a + b + c)^-1 * (a + b + c + d)^-1 * (a + c)^-1 * b * d)
as.ranktable(t(replicate(10, rrace(o)))) # same as rrank(10,o)
#> A ranktable:
#> c1 c2 c3 c4
#> [1,] b a c d
#> [2,] b a c d
#> [3,] a c b d
#> [4,] b a d c
#> [5,] c a d b
#> [6,] b c a d
#> [7,] b a c d
#> [8,] b a c d
#> [9,] b a c d
#> [10,] c a b d