In the description for order{base} function:
order returns a permutation which rearranges its first argument into ascending or descending order, breaking ties by further arguments.
I understand that x[order(x)] returns the same result as sort(x),but i don't understand what passing further arguments do,like in the first example in documentation:
>(ii <- order(x <- c(1,1,3:1,1:4,3), y <- c(9,9:1), z <- c(2,1:9)))
[1] 6 5 2 1 7 4 10 8 3 9
>rbind(x, y, z)[,ii] # shows the reordering (ties via 2nd & 3rd arg)