.BG
.FN order
.TL
Ordering to Create Sorted Data
.CS
order(...)
.AG ...
any number of vectors.
All arguments must have the same length.
.RT
integer vector with same number of elements as data elements
in the arguments.  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,
sorting is based on the
.Sc ASCII
collating sequence.
.PP
Ordering is primarily based on the first argument.
Values of the second argument break ties in the first, and so on.
All sorting is done in ascending order.
.PP
This function is often used in conjunction with subscripting
for sorting several parallel arrays.
An implementation limitation causes numeric comparisons to currently
be done in single precision, and does not allow the use of complex
arguments.
The function `sort.list' does not have these limitations, but only takes
one argument.  Otherwise, the two functions are identical.
.SA
`sort.list', `rank' and `sort'.
.EX
# ordering by salary within age
ord <- order(age,salary)
cbind(x[ord],y[ord],z[ord])
.KW manip
.WR
