\Header{sort}{Sort a Vector}
\keyword{univar}{sort}
\keyword{manip}{sort}
\keyword{arith}{sort}
\begin{Usage}
\begin{verbatim}
sort(x, partial = NULL, na.last = NA)
\end{verbatim}
\end{Usage}
\begin{Details}
If \texttt{partial} is non \texttt{NULL}, it is taken to contain indexes
of elements of \texttt{x} which are to be placed in their correct
positions by partial sorting.  After the sort, the values specified in
\texttt{partial} are in their correct position in the sorted array.  Any
values smaller than these values are guaranteed to have a smaller
index in the sorted array and any values which are greater are
guaranteed to have a bigger index in the sorted array.

If \texttt{na.last} is \texttt{NA}, \texttt{sort} removes missing values.
If \texttt{na.last} is \texttt{TRUE}, missing values are put last, if
\texttt{FALSE}, missing values are put first.\end{Details}
\begin{SeeAlso}
\texttt{\Link{order}}, \texttt{\Link{rank}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(swiss)
x <- swiss$Education[1:25]
x; sort(x); sort(x, partial = c(10,15))
median # shows you another example for `partial'
\end{ExampleCode}
\end{Examples}

