I would like to number the elements of a vector, assigning \'1\' to the smallest element in the vector. I know how to do this, but my solution (code included below) seems o
Another possibility is:
> rank(data) [1] 2.0 3.5 5.5 5.5 3.5 1.0 7.0
You can see the argument "ties.method" for how to handle ties.