\Header{which.is.max}{Find Maximum Position in Vector}
\keyword{utilities}{which.is.max}
\begin{Description}\relax
Find the maximum position in a vector, breaking ties at random.
\end{Description}
\begin{Usage}
\begin{verbatim}
which.is.max(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a vector

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Ties are broken at random.
\end{Details}
\begin{Value}
index of a maximal value.\end{Value}
\begin{References}\relax
Venables, W. N. and Ripley, B. D. (2002)
\emph{Modern Applied Statistics with S.} Fourth edition.  Springer.
\end{References}
\begin{SeeAlso}\relax
\code{\Link{max.col}}, \code{\Link{which.max}} which takes the first of ties.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Not run: 
pred <- predict(nnet, test)
table(true, apply(pred,1,which.is.max))
## End(Not run)\end{ExampleCode}
\end{Examples}

