available.packages {utils} | R Documentation |
available.packages
returns a matrix of details corresponding to
packages currently available at one or more repositories. The
current list of packages is downloaded over the internet (or copied
from a local mirror).
available.packages(contriburl = contrib.url(getOption("repos"), type), method, fields = NULL, type = getOption("pkgType"), filters = NULL)
contriburl |
URL(s) of the ‘contrib’ sections of the repositories. Specify this argument only if your repository mirror is incomplete, e.g., because you burned only the ‘contrib’ section on a CD. |
method |
download method, see download.file .
|
type |
character string, indicate which type of packages: see
install.packages .
|
fields |
a character vector giving the fields to extract from
the ‘PACKAGES’ file(s) in addition to the default ones, or
NULL (default). Unavailable fields result in NA
values.
|
filters |
a character vector or list or NULL (default). See ‘Details’.
|
By default, this includes only packages whose version and OS type requirements are met by the running version of R, and only information on the latest versions of packages with duplicates removed.
As from R 2.10.0 argument filters
used to select which of the
packages on the repositories are reported. It is called with its
default value (NULL
) by functions such as
install.packages
: this value corresponds to
getOption("available_packages_filters")
and to
c("R_version", "OS_type", "duplicates")
if that is unset or set
to NULL
.
The built-in filters are
"R_version"
"OS_type"
"duplicates"
contriburl
) with the latest version if that
is in more than one repository."license/FOSS"
filters
should be a list with
elements which are character strings, user-defined function or
add = TRUE
.
User-defined filters are functions which take a single argument, a
matrix of the form returned by by available.packages
, and
return a matrix with a subset of the rows of the argument.
The special ‘filter’ add=TRUE
appends the other elements
of the filter list to the default filters.
A matrix with one row per package, row names the package names and
column names "Package"
, "Version"
, "Priority"
,
"Depends"
, "Imports"
, "LinkingTo"
,
"Suggests"
, "Enhances"
, "OS_type"
,
"License"
, "File"
and "Repository"
. Additional
columns can be specified using the fields
argument.
install.packages
, download.packages
,
contrib.url
.
The ‘R Installation and Administration’ manual for how to set up a repository.