\HeaderA{install.packages2}{Functions to download, install and manipulate local packages}{install.packages2}
\aliasA{baseFileSelect}{install.packages2}{baseFileSelect}
\aliasA{buildRepList}{install.packages2}{buildRepList}
\aliasA{checkPrevRepos}{install.packages2}{checkPrevRepos}
\aliasA{getMaxVersReposInfo}{install.packages2}{getMaxVersReposInfo}
\aliasA{handleDownloadedFile}{install.packages2}{handleDownloadedFile}
\aliasA{installPkg}{install.packages2}{installPkg}
\aliasA{installPkgListing}{install.packages2}{installPkgListing}
\aliasA{remove.packages2}{install.packages2}{remove.packages2}
\aliasA{update.packages2}{install.packages2}{update.packages2}
\keyword{utilities}{install.packages2}
\begin{Description}\relax
These functions are designed to allow the user to
install, update and download packages from R repositories, as well as
remove packages from their local system.
\end{Description}
\begin{Usage}
\begin{verbatim}
install.packages2(pkgs = NULL, repEntry = NULL, lib, versions, type,
                 method = "auto", theme= NULL, recurse = TRUE, searchOptions =
                 FALSE, getNewest = TRUE, force = FALSE, versForce =
                 TRUE, getAllDeps = FALSE, fileSelect =
                 baseFileSelect, develOK=FALSE)
update.packages2(pkgs = NULL, repEntry = NULL, theme = NULL, libs =
                 reposToolsLibPaths(), type, method = "auto",
                 prevRepos = TRUE, recurse = TRUE, searchOptions =
                 FALSE, force = FALSE, versForce = TRUE, getAllDeps =
                 FALSE, develOK=FALSE)
remove.packages2(pkgs, lib, force=FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{repEntry}] A ReposEntry object specifying a particular repository
\item[\code{pkgs}] A character vector of package name(s) to act upon
\item[\code{theme}] A character vector of repository theme(s) to install
\item[\code{versions}] A character vector of version numbers for the packages
\item[\code{lib}] A path to install (or remove from) the package.  If this
directory does not exist, it will be created (if possible).  If this
directory is not in the user's current \code{.libPaths()}, it will be added.
\item[\code{libs}] A set of library path(s) to search for packages to update
\item[\code{prevRepos}] Whether or not to update a package from the
repository it was installed from
\item[\code{force}] Whether or not to ignore any dependencies
\item[\code{fileSelect}] Function to determine if a package needs updating or
not
\item[\code{recurse}] Whether to search through subrepositories for desired packages
\item[\code{type}] The type of package to download/install/etc (e.g. Source,
Win32, etc)
\item[\code{searchOptions}] Whether to search repositories listed in
options("repositories") as well as specified repositories.  Default
is FALSE which means that if one specifies a repository, *only* that
repository is used.  If set to TRUE, and a user specifies a
repository, then any repositories set in the user's options will
also be used.
\item[\code{versForce}] Whether or not to override R version checking on
binary packages
\item[\code{getNewest}] Whether or not to just get the newest available
version of a package, or to provide alternate means (currently a
menu selection) of obtaining a package
\item[\code{install}] Whether or not to install the downloaded package
\item[\code{update}] Whether to seek to update the package or simply install
the requested version
\item[\code{getAllDeps}] Will automatically download all dependencies if
TRUE, otherwise will prompt the user
\item[\code{method}] Defaults to "auto", identical to the same parameter used
for \code{download.file}
\item[\code{develOK}] Deprecated.  If you wish to install development
versions of Bioconductor packages, please install a development
version of R.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
If the user uses the \code{versions} argument, the number of items in
\code{versions} must match the number of items in \code{pkgs} and they
are considered to be a one-to-one matching.

For install.packages2, update.packages2, and remove.packages2, the
system will by default check to insure that no dependencies from other
packages are being broken.  This can be overridden using \code{force=TRUE}.

Also for all packages, the \code{type} parameter's default depends on
the user's OS.  If the user is using a windows machine, the default
\code{type} to download from a repository is \code{Win32}, otherwise
it is \code{Source}.

\code{install.packages2}:  User can specify a ReposEntry object,
and/or a set of packages or a set of themes.  If no package names or
themes are specified, it is assumed the user wants everything
available in the repository denoted by the ReposEntry.  If a theme (or
themes) are specified, then any package directives are ignored
(installation of themes is an all or nothing event).  Will install
packages requested into the library directory specified.  If
recurse==TRUE, will also search through any of the repository's listed
subrepositories to find packages.  Likewise, if searchOptions==TRUE,
will also look in the repositories listed by options("repositories")
(So, if one specifies packages w/o a ReposEntry, it will only look
here).  For more information on themes, see the help page on
\code{\LinkA{repositoryThemes}{repositoryThemes}}.  

\code{update.packages2}:  Used to update a user's packages.  Much like
\code{install.packages2}, can take (or not) a \code{ReposEntry} object
and also can be told to utilize the "repositories" option.  A set of
packages can be specified, the packages from one or more  \code{\LinkA{themes}{themes}} can be requested,
or alternatively all packages in the specified 'libs' parameter will
be used.  If prevRepos==TRUE, the system will attempt to ascertain
where the package was actually installed from previously and will
update from there instead. 

\code{remove.packages2}: Will remove packages specified by 'pkgs' from the
libPath noted by 'lib' and reflect this change in the local library
listing.

For \code{install.packages2} and \code{update.packages2}, an object of
class \code{\LinkA{pkgStatusList}{pkgStatusList}} is returned.  This can be used to
report (and by default, the \code{show} method is invoked if this
output is not assigned to a variable) what packages were donwloaded
and from where.  Also, the \code{matchesList} slot of the object can
be referenced to find any potential matches for packages were not
found (in the case of mispellings and the like).
\end{Details}
\begin{Value}
An object of class \code{\LinkA{pkgStatusList}{pkgStatusList}}
\end{Value}
\begin{Author}\relax
Jeff Gentry
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{syncLocalLibList}{syncLocalLibList}},\code{\LinkA{ReposEntry}{ReposEntry}},\code{\LinkA{genRepos}{genRepos}},\code{\LinkA{pkgInfo}{pkgInfo}},
\code{\LinkA{download.packages2}{download.packages2}}, \code{\LinkA{repositoryThemes}{repositoryThemes}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## set up a temporary directory for use with these examples
## this directory will be used with the this-is-escaped-code{
## parameter.  For normal usage, most users will be okay with using
## the defaults of this-is-escaped-codenormal-bracket98bracket-normal and not need to specify manually
tmpLib <- tempfile()
dir.create(tmpLib)

## install a package from the standard repositories (listed by
## the command this-is-escaped-codenormal-bracket99bracket-normal
install.packages2("hu6800",lib=tmpLib)
## and another one from CRAN
install.packages2("abind",lib=tmpLib)
\end{ExampleCode}
\end{Examples}


