Skip to content
Prev 68044 / 398506 Next

Ranking within a classification variable.

Here's one way:
x f
1  0.06928792 1
2  0.55972448 1
3  0.39285280 1
4  0.72547126 1
5  0.69027628 1
6  0.51918727 1
7  0.62048040 2
8  0.42240036 1
9  0.90938702 1
10 0.16013661 2
x f rank
1  0.06928792 1    1
3  0.39285280 1    2
8  0.42240036 1    3
6  0.51918727 1    4
2  0.55972448 1    5
5  0.69027628 1    6
4  0.72547126 1    7
9  0.90938702 1    8
10 0.16013661 2    1
7  0.62048040 2    2

Don't know how this rates on the slick-quick-sexy scale...

Andy