\HeaderA{zpackages}{Listing of Packages}{zpackages}
\aliasA{.packages}{zpackages}{.packages}
\keyword{data}{zpackages}
\begin{Description}\relax
\code{.packages} returns information about package availability.
\end{Description}
\begin{Usage}
\begin{verbatim}
.packages(all.available = FALSE, lib.loc = NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{all.available}] logical; if \code{TRUE} return a character vector
of all available packages in \code{lib.loc}.
\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.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{.packages()} returns the names of the currently
attached packages \emph{invisibly} whereas
\code{.packages(all.available = TRUE)} gives (visibly) \emph{all}
packages available in the library location path \code{lib.loc}.
If versioned installs have been used, the names returned will be of the
form \code{pkgname\_version}. 

For a package to be regarded as being available it must have a
\file{DESCRIPTION} file containing a valid \code{version} field.
\end{Details}
\begin{Value}
A character vector of package base names, invisible unless
\code{all.available = TRUE}.
\end{Value}
\begin{Author}\relax
R core;
Guido Masarotto for the \code{all.available=TRUE} part of
\code{.packages}.
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{library}{library}}, \code{\LinkA{.libPaths}{.libPaths}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
(.packages())               # maybe just "base"
.packages(all.available = TRUE) # return all available as character vector
require(splines)
(.packages())               # "splines", too
detach("package:splines")
\end{ExampleCode}
\end{Examples}

