.BG
.VE $Header: /usr/s/current/s/.help/RCS/order,v 1.3 86/10/07 15:24:04 rab Exp $
.FN order
.TL
order: Ordering to Create Sorted Data
.CS
order(x1, x2, ...)
.PP
.AG xi
vector.
All arguments must have the same length.
.RT
integer vector with same number of elements as data elements
in `xi'.  Contains the indices of the data elements in
ascending order, i.e., the first integer is the subscript of
the smallest data element, etc.  For character vectors, the
sorting order is lexicographic.
.PP
Sorting is primarily based on vector `x1'.  Values of `x2' are used to
break ties on `x1', etc.  All sorting is done in ascending order.
.EX
# sort x and rearrange y and z to match
olist <- order(x)
cbind(x[olist],y[olist],z[olist])
.PP
This function is often used in conjunction with subscripting
for sorting several parallel arrays.
.KW basic*
.KW sorting
.KW math
.WR
