old.packages indicates packages which have a (suitable) later
version on the repositories whereas
update.packages offers to
download and install such packages.
new.packages looks for (suitable) packages on the repositories
that are not already installed, and optionally offers them for
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
update.packages(lib.loc = NULL, repos = getOption("repos"), contriburl = contrib.url(repos, type), method, instlib = NULL, ask = TRUE, available = NULL, oldPkgs = NULL, ..., checkBuilt = FALSE, type = getOption("pkgType")) old.packages(lib.loc = NULL, repos = getOption("repos"), contriburl = contrib.url(repos, type), instPkgs = installed.packages(lib.loc = lib.loc, ...), method, available = NULL, checkBuilt = FALSE, ..., type = getOption("pkgType")) new.packages(lib.loc = NULL, repos = getOption("repos"), contriburl = contrib.url(repos, type), instPkgs = installed.packages(lib.loc = lib.loc, ...), method, available = NULL, ask = FALSE, ..., type = getOption("pkgType"))
character vector describing the location of R
library trees to search through (and update packages therein), or
character vector, the base URL(s) of the repositories
to use, e.g., the URL of a CRAN mirror such as
URL(s) of the contrib sections of the
repositories. Use this argument if your repository is
incomplete. Overrides argument
Download method, see
character string giving the library directory where to install the packages.
logical indicating whether to ask the user to select
packages before they are downloaded and installed, or the character
an object as returned by
if specified as non-NULL,
by default all installed packages,
Arguments such as
character, indicating the type of package to download and
old.packages compares the information from
available.packages with that from
instPkgs (computed by
installed.packages by default) and reports installed
packages that have newer versions on the repositories or, if
checkBuilt = TRUE, that were built under an earlier minor
version of R (for example built under 3.3.x when running R 3.4.0).
(For binary package types there is no check that the version on the
repository was built under the current minor version of R,
but it is advertised as being suitable for this version.)
new.packages does the same comparison but reports uninstalled
packages that are available at the repositories. If
FALSE it asks which packages should be installed in the first element
The main function of the set is
update.packages. First a list
of all packages found in
lib.loc is created and compared with
those available at the repositories. If
ask = TRUE (the
default) packages with a newer version are reported and for each one
the user can specify if it should be updated. If so the packages are
downloaded from the repositories and installed in the respective
library path (or
instlib if specified).
For how the list of suitable available packages is determined see
available = NULL make a call
available.packages(contriburl = contriburl, method = method)
and hence by default filters on R version, OS type and removes
NULL or a matrix with one row per
package, row names the package names and column names
"Installed" (the version),
"Built" (the version built under),
new.packages a character vector of package names,
after any selected via
ask have been installed.
Take care when using
dependencies (passed to
for it is unclear where new dependencies should be installed. The
current implementation will only allow it if all the packages to be
updated are in a single library, when that library will be used.
The options listed for
download.file for how to handle proxies and
other options to monitor file transfers.
The ‘R Installation and Administration’ manual for how to set up a repository.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.