\HeaderA{packageStatus}{Package Management Tools}{packageStatus}
\aliasA{print.packageStatus}{packageStatus}{print.packageStatus}
\aliasA{summary.packageStatus}{packageStatus}{summary.packageStatus}
\aliasA{update.packageStatus}{packageStatus}{update.packageStatus}
\aliasA{upgrade}{packageStatus}{upgrade}
\methaliasA{upgrade.packageStatus}{packageStatus}{upgrade.packageStatus}
\keyword{utilities}{packageStatus}
\begin{Description}\relax
Summarize information about installed packages and packages
available at various repositories, and automatically upgrade outdated
packages.
\end{Description}
\begin{Usage}
\begin{verbatim}
packageStatus(lib.loc = NULL, repositories = NULL, method,
              type = getOption("pkgType"))

## S3 method for class 'packageStatus':
summary(object, ...)

## S3 method for class 'packageStatus':
update(object, lib.loc = levels(object$inst$LibPath),
       repositories = levels(object$avail$Repository), ...)

## S3 method for class 'packageStatus':
upgrade(object, ask = TRUE, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{lib.loc}] a character vector describing the location of \R{}
library trees to search through, or \code{NULL}.  The default value
of \code{NULL} corresponds to all libraries currently known.
\item[\code{repositories}] a character vector of URLs describing the location of \R{}
package repositories on the Internet or on the local machine.
\item[\code{method}] Download method, see \code{\LinkA{download.file}{download.file}}.
\item[\code{type}] type of package distribution:
see \code{\LinkA{install.packages}{install.packages}}.
\item[\code{object}] an object of class \code{"packageStatus"} as returned by
\code{packageStatus}.
\item[\code{ask}] if \code{TRUE}, the user is prompted which packages should
be upgraded and which not.
\item[\code{...}] currently not used.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The URLs in \code{repositories} should be full paths to the
appropriate contrib sections of the repositories.  The default is
\code{contrib.url(getOption("repos"))}.  (Prior to \R{} 2.1.0 this was
hardcoded as the CRAN and Bioconductor repositories.)

There are \code{print} and \code{summary} methods for the
\code{"packageStatus"} objects: the \code{print} method gives a brief
tabular summary and the \code{summary} method prints the results.

The \code{update} method updates the \code{"packageStatus"} object.
The \code{upgrade} method is similar to \code{\LinkA{update.packages}{update.packages}}:
it offers to install the current versions of those packages which are not
currently up-to-date.
\end{Details}
\begin{Value}
An object of class \code{"packageStatus"}.  This is a list with two
components

\begin{ldescription}
\item[\code{inst}] a data frame with columns as the \emph{matrix} returned by
\code{\LinkA{installed.packages}{installed.packages}} plus \code{"Status"}, a factor with
levels \code{c("ok", "upgrade")}.  Only the newest version of each
package is reported, in the first repository in which it appears.

\item[\code{avail}] a data frame with columns as the \emph{matrix} returned by
\code{\LinkA{available.packages}{available.packages}} plus \code{"Status"}, a factor with
levels \code{c("installed", "not installed", "unavailable")}..

\end{ldescription}
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{installed.packages}{installed.packages}}, \code{\LinkA{available.packages}{available.packages}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Not run: 
x <- packageStatus()
print(x)
summary(x)
upgrade(x)
x <- update(x)
print(x)
## End(Not run)\end{ExampleCode}
\end{Examples}

