| Line 1... |
Line 1... |
| 1 |
% File src/library/utils/man/installed.packages.Rd
|
1 |
% File src/library/utils/man/installed.packages.Rd
|
| 2 |
% Part of the R package, https://www.R-project.org
|
2 |
% Part of the R package, https://www.R-project.org
|
| 3 |
% Copyright 1995-2010 R Core Team
|
3 |
% Copyright 1995-2017 R Core Team
|
| 4 |
% Distributed under GPL 2 or later
|
4 |
% Distributed under GPL 2 or later
|
| 5 |
|
5 |
|
| 6 |
\name{installed.packages}
|
6 |
\name{installed.packages}
|
| 7 |
\alias{installed.packages}
|
7 |
\alias{installed.packages}
|
| 8 |
\title{Find Installed Packages}
|
8 |
\title{Find Installed Packages}
|
| Line 11... |
Line 11... |
| 11 |
libraries.
|
11 |
libraries.
|
| 12 |
}
|
12 |
}
|
| 13 |
\usage{
|
13 |
\usage{
|
| 14 |
installed.packages(lib.loc = NULL, priority = NULL,
|
14 |
installed.packages(lib.loc = NULL, priority = NULL,
|
| 15 |
noCache = FALSE, fields = NULL,
|
15 |
noCache = FALSE, fields = NULL,
|
| 16 |
subarch = .Platform$r_arch)
|
16 |
subarch = .Platform$r_arch, \dots)
|
| 17 |
}
|
17 |
}
|
| 18 |
\arguments{
|
18 |
\arguments{
|
| 19 |
\item{lib.loc}{
|
19 |
\item{lib.loc}{
|
| 20 |
character vector describing the location of \R library trees to
|
20 |
character vector describing the location of \R library trees to
|
| 21 |
search through, or \code{NULL} for all known trees
|
21 |
search through, or \code{NULL} for all known trees
|
| Line 31... |
Line 31... |
| 31 |
|
31 |
|
| 32 |
\item{fields}{a character vector giving the fields to extract from
|
32 |
\item{fields}{a character vector giving the fields to extract from
|
| 33 |
each package's \code{DESCRIPTION} file in addition to the default
|
33 |
each package's \code{DESCRIPTION} file in addition to the default
|
| 34 |
ones, or \code{NULL} (default). Unavailable fields result in
|
34 |
ones, or \code{NULL} (default). Unavailable fields result in
|
| 35 |
\code{NA} values.}
|
35 |
\code{NA} values.}
|
| - |
|
36 |
|
| 36 |
\item{subarch}{character string or \code{NULL}. If non-null and
|
37 |
\item{subarch}{character string or \code{NULL}. If non-null and
|
| 37 |
non-empty, used to select packages which are installed for that
|
38 |
non-empty, used to select packages which are installed for that
|
| 38 |
sub-architecture.
|
39 |
sub-architecture.}
|
| 39 |
}
|
40 |
|
| - |
|
41 |
\item{\dots}{allows unused arguments to be passed down from other functions.}
|
| 40 |
}
|
42 |
}
|
| 41 |
\details{
|
43 |
\details{
|
| 42 |
\code{installed.packages} scans the \file{DESCRIPTION} files of each
|
44 |
\code{installed.packages} scans the \file{DESCRIPTION} files of each
|
| 43 |
package found along \code{lib.loc} and returns a matrix of package
|
45 |
package found along \code{lib.loc} and returns a matrix of package
|
| 44 |
names, library paths and version numbers.
|
46 |
names, library paths and version numbers.
|
| 45 |
|
47 |
|
| 46 |
The information found is cached (by library) for the \R session and
|
48 |
The information found is cached (by library) for the \R session and
|
| 47 |
specified \code{fields} argument, and updated only if the top-level
|
49 |
specified \code{fields} argument, and updated only if the top-level
|
| 48 |
library directory has been altered, for example by installing or
|
50 |
library directory has been altered, for example by installing or
|
| 49 |
removing a package. If the cached information becomes confused, it
|
51 |
removing a package. If the cached information becomes confused, it
|
| 50 |
can be refreshed by running \code{installed.packages(noCache =
|
52 |
can be avoided by specifying \code{noCache = TRUE}.
|
| 51 |
TRUE)}.
|
- |
|
| 52 |
}
|
53 |
}
|
| 53 |
\value{
|
54 |
\value{
|
| 54 |
A matrix with one row per package, row names the package names and
|
55 |
A matrix with one row per package, row names the package names and
|
| 55 |
column names (currently)
|
56 |
column names (currently)
|
| 56 |
\code{"Package"}, \code{"LibPath"},
|
57 |
\code{"Package"}, \code{"LibPath"},
|
| Line 61... |
Line 62... |
| 61 |
\code{"Built"} (the \R version the package was built under).
|
62 |
\code{"Built"} (the \R version the package was built under).
|
| 62 |
Additional columns can be specified using the \code{fields}
|
63 |
Additional columns can be specified using the \code{fields}
|
| 63 |
argument.
|
64 |
argument.
|
| 64 |
}
|
65 |
}
|
| 65 |
\note{
|
66 |
\note{
|
| - |
|
67 |
This needs to read several files per installed package, which will be
|
| - |
|
68 |
slow on Windows and on some network-mounted file systems.
|
| - |
|
69 |
|
| 66 |
This can be slow when thousands of packages are installed, so do not
|
70 |
It will be slow when thousands of packages are installed, so do not
|
| 67 |
use this to find out if a named package is installed (use
|
71 |
use it to find out if a named package is installed (use
|
| 68 |
\code{\link{system.file}} or \code{\link{find.package}}) nor to find
|
72 |
\code{\link{find.package}} or \code{\link{system.file}}) nor to find
|
| 69 |
out if a package is usable (call \code{\link{require}} and check the
|
73 |
out if a package is usable (call \code{\link{requireNamespace}} or
|
| 70 |
return value) nor to find details of a small number of packages (use
|
- |
|
| 71 |
\code{\link{packageDescription}}). It needs to read several files per
|
74 |
\code{\link{require}} and check the return value) nor to find details
|
| 72 |
installed package, which will be slow on Windows and on some
|
75 |
of a small number of packages (use \code{\link{packageDescription}}).
|
| 73 |
network-mounted file systems.
|
- |
|
| 74 |
}
|
76 |
}
|
| 75 |
\seealso{
|
77 |
\seealso{
|
| 76 |
\code{\link{update.packages}},
|
78 |
\code{\link{update.packages}},
|
| 77 |
\code{\link{install.packages}},
|
79 |
\code{\link{install.packages}},
|
| 78 |
\code{\link{INSTALL}}, \code{\link{REMOVE}}.
|
80 |
\code{\link{INSTALL}}, \code{\link{REMOVE}}.
|