Open RobinHankin opened 4 years ago
One line at a time is easy:
> p <- (9:1)/45
> (x <- rrank(n=1,p))
c1 c2 c3 c4 c5 c6 c7 c8 c9
[1,] 3 4 2 5 8 6 9 1 7
> order(x)
[1] 8 3 1 2 4 6 9 5 7
>
Thus player 8 came first, player 3 came second, player 1 came third, and so on.
Currently one needs to specify the pnames
argument:
> p <- (5:1)/15
> rrank(2,p,pnames=letters[1:5])
c1 c2 c3 c4 c5
[1,] a d b c e
[2,] b a c e d
>
... but one might expect the following to assign names:
> p <- (5:1)/15
> names(p) <- letters[1:5]
> rrank(n=1,p)
c1 c2 c3 c4 c5
[1,] 3 5 1 4 2
and it doesn't.
215ced2837d1182e562fd2a9310b247fe044f624 converts order tables to rank tables, might be relevant.
Function
rrank()
gives a random rank table but we needrorder()
to create a table likevolvo_table_2014
.