

   OOrrddeerriinngg PPeerrmmuuttaattiioonn

        order(...)

   AArrgguummeennttss::

        ...: a sequence of vectors.

   DDeessccrriippttiioonn::

        `order' returns a permutation which will rearrange its
        first argument into ascending order.  In the case of
        ties in the first vector, values in the second are used
        to break the ties.  If the values are still tied, val-
        ues in the later arguments are used to break the tie.

        `NA' values are treated as greater than any other val-
        ues so that permutations returned by `order' move `NA'
        values to the top end of the array.

   SSeeee AAllssoo::

        `sort'.

   EExxaammpplleess::

        x <- c(5:1, 6:8, 12:9)
        y <- (x - 5)^2
        # rearrange matched vectors so that
        # the first is in ascending order
        o <- order(x)
        rbind(x[o], y[o])

