Find Installed Packages
Find (or retrieve) details of all packages installed in the specified libraries.
installed.packages(lib.loc = NULL, priority = NULL, noCache = FALSE, fields = NULL, subarch = .Platform$r_arch)
- character vector describing the location of Rlibrary trees to
search through, or
NULLfor all known trees (see
- character vector or
NULL(default). If non-null, used to select packages;
"high"is equivalent to
c("base", "recommended"). To select all packages without an assigned priority use
priority = "NA".
- Do not use cached information, nor cache it.
- a character vector giving the fields to extract from
DESCRIPTIONfile in addition to the default ones, or
NULL(default). Unavailable fields result in
- character string or
NULL. If non-null and non-empty, used to select packages which are installed for that sub-architecture.
installed.packages scans the
lib.loc and returns a matrix of package
names, library paths and version numbers.
The information found is cached (by library) for the Rsession and
fields argument, and updated only if the top-level
library directory has been altered, for example by installing or
removing a package. If the cached information becomes confused, it
can be refreshed by running
- A matrix with one row per package, row names the package names and
column names (currently)
"Built"(the Rversion the package was built under). Additional columns can be specified using the
This can be slow when thousands of packages are installed, so do not
use this to find out if a named package is installed (use
find.package) nor to find
out if a package is usable (call
require and check the
return value) nor to find details of a small number of packages (use
packageDescription). It needs to read several files per
installed package, which will be slow on Windows and on some
network-mounted file systems.
## confine search to .Library for speed str(ip <- installed.packages(.Library, priority = "high")) ip[, c(1,3:5)] plic <- installed.packages(.Library, priority = "high", fields = "License") ## what licenses are there: table( plic[, "License"] )