I am trying to rank the values of a row. I am trying to see which value is largest, which is second largest etc etc.
Here is a simple example:
test = c(0.005,0.007,0.009,-0.0008,0.5,-0.074)
order(test)
[1] 6 4 1 2 3 5
which.max(test)
[1] 5
The function which.max correctly gives me the column with the largest value, but it doesn't give me the second largest, third largest etc., etc.
I believed I could use the function order for this, but the output of that doesn't seem to be correct.
What am I doing wrong?