\Header{compareVersion}{Compare Two Package Version Numbers}
\keyword{utilities}{compareVersion}
\begin{Description}\relax
Compare two package version numbers to see which is later.
\end{Description}
\begin{Usage}
\begin{verbatim}
compareVersion(a, b)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{a, b}] Character strings representing package version numbers.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\R{} package version numbers are of the form \code{x.y-z} for integers
\code{x}, \code{y} and \code{z}, with components after \code{x}
optionally missing (in which case the version number is older than
those with the components present).
\end{Details}
\begin{Value}
\code{0} if the numbers are equal, \code{-1} if \code{b} is later
and \code{1} if \code{a} is later (analogous to the C function
\code{strcmp}).
\end{Value}
\begin{SeeAlso}\relax
\code{\Link{library}}, \code{\Link{packageStatus}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
compareVersion("1.0", "1.0-1")
compareVersion("7.2-0","7.1-12")
\end{ExampleCode}
\end{Examples}

