\HeaderA{getPkgVers}{Information for an installed package}{getPkgVers}
\aliasA{is.installed}{getPkgVers}{is.installed}
\keyword{utilities}{getPkgVers}
\begin{Description}\relax
These functions retrieve information on installed packages, including
whether or not a package is installed.
\end{Description}
\begin{Usage}
\begin{verbatim}
is.installed(pkg, vers=NULL, verbose=TRUE, oper="==", libs)
getPkgVers(pkg, libs = reposToolsLibPaths(), verbose=TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{pkg}] The package to check
\item[\code{vers}] The version of the package.  NULL implies any version
\item[\code{libs}] A R library directory (or vector of directories).
\item[\code{verbose}] Extra diagnostics
\item[\code{oper}] Allows for a version test instead of a direct '=='
\end{ldescription}
\end{Arguments}
\begin{Value}
is.installed: This function will return a logical representing if the
specified package is installed or not.  The version parameter
defaults to NULL, which implies any version of the package.  If a
version is specified, it can be either as a string or as a
\code{VersionNumber} object.  If the former, it will be coerced to
the latter.  Argument \code{oper} can be any comparitive function
(>, <, !=, etc), but defaults to \code{==}.  This is the comparator
applied to see if a package of a given version is installed.

getPkgVers:  This function returns a list containing all version
numbers of any instance of the package being isntalled.  If the
package is installed only in one occassion, it will be a single
element list.  If the package is installed multiple times, each
instance will have a corresponding version number.  Likewise, an
empty list is returned if the package is not installed.  The
\code{VersionNumber} class is used for the return value.
\end{Value}
\begin{Author}\relax
Jeff Gentry
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{VersionNumber}{VersionNumber}}, \code{\LinkA{reposToolsLibPaths}{reposToolsLibPaths}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  lib <- paste(.find.package("reposTools"),"data/",sep="/")
  getPkgVers("reposTools",lib)
\end{ExampleCode}
\end{Examples}


