install.packages2 {reposTools}R Documentation

Functions to download, install and manipulate local packages


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.


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)


repEntry A ReposEntry object specifying a particular repository
pkgs A character vector of package name(s) to act upon
theme A character vector of repository theme(s) to install
versions A character vector of version numbers for the packages
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 .libPaths(), it will be added.
libs A set of library path(s) to search for packages to update
prevRepos Whether or not to update a package from the repository it was installed from
force Whether or not to ignore any dependencies
fileSelect Function to determine if a package needs updating or not
recurse Whether to search through subrepositories for desired packages
type The type of package to download/install/etc (e.g. Source, Win32, etc)
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.
versForce Whether or not to override R version checking on binary packages
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
install Whether or not to install the downloaded package
update Whether to seek to update the package or simply install the requested version
getAllDeps Will automatically download all dependencies if TRUE, otherwise will prompt the user
method Defaults to "auto", identical to the same parameter used for download.file
develOK Deprecated. If you wish to install development versions of Bioconductor packages, please install a development version of R.


If the user uses the versions argument, the number of items in versions must match the number of items in 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 force=TRUE.

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

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 repositoryThemes.

update.packages2: Used to update a user's packages. Much like install.packages2, can take (or not) a 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 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.

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

For install.packages2 and update.packages2, an object of class pkgStatusList is returned. This can be used to report (and by default, the show method is invoked if this output is not assigned to a variable) what packages were donwloaded and from where. Also, the 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).


An object of class pkgStatusList


Jeff Gentry

See Also

syncLocalLibList,ReposEntry,genRepos,pkgInfo, download.packages2, repositoryThemes


## 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()

## install a package from the standard repositories (listed by
## the command this-is-escaped-codenormal-bracket99bracket-normal
## and another one from CRAN

[Package reposTools version 1.8.0 Index]