zpackages

0th

Percentile

Listing of Packages

.packages returns information about package availability.

Keywords
data
Usage
.packages(all.available = FALSE, lib.loc = NULL)
Arguments
all.available

logical; if TRUE return a character vector of all available packages in lib.loc.

lib.loc

a character vector describing the location of R library trees to search through, or NULL. The default value of NULL corresponds to .libPaths().

Details

.packages() returns the names of the currently attached packages invisibly whereas .packages(all.available = TRUE) gives (visibly) all packages available in the library location path lib.loc.

For a package to be regarded as being ‘available’ it must have valid metadata (and hence be an installed package). However, this will report a package as available if the metadata does not match the directory name: use find.package to confirm that the metadata match or installed.packages for a much slower but more comprehensive check of ‘available’ packages.

Value

A character vector of package base names, invisible unless all.available = TRUE.

Note

.packages(all.available = TRUE) is not a way to find out if a small number of packages are available for use: not only is it expensive when thousands of packages are installed, it is an incomplete test. See the help for find.package for why require should be used.

See Also

library, .libPaths, installed.packages.

Aliases
  • .packages
Examples
library(base) # NOT RUN { (.packages()) # maybe just "base" .packages(all.available = TRUE) # return all available as character vector require(splines) (.packages()) # "splines", too detach("package:splines") # }
Documentation reproduced from package base, version 3.5.1, License: Part of R 3.5.1

Community examples

Looks like there are no examples yet.