List Available Packages

DESCRIPTION:

Look in the standard S-PLUS library and module directories or in specified directories for available packages (libraries), and return either the package names or the paths to the package directories.

USAGE:

.packages(all.available=FALSE, lib.loc=NULL, paths=FALSE)

OPTIONAL ARGUMENTS:

all.available
a logical value indicating whether to look for all packages or only ones that are attached. The default (FALSE) is to only return attached libraries.
lib.loc
a character vector giving the location of library directories to search for packages. The default value of 'NULL' corresponds to all libraries currently known.
paths
a logical value. If TRUE, the full path names of the packages are returned, otherwise only the package base names are returned. The default value is FALSE.

VALUE:

A character vector containing the names of packages found in the directories given by the lib.loc argument or in the S-PLUS library and module directories. By default, only attached packages will be included, unless all.available=TRUE. Only the base names of packages will be returned, unless paths=TRUE .

DETAILS:

This function emulates the R function .packages, but with a few exceptions noted below.

R requires that a package directory have a DESCRIPTION file having a valid 'version' field, but the S-PLUS version of this function requires the existence of either a DESCRIPTION file or a .Data directory in the package directory.

The R version of this function returns its value invisibly unless all.available=TRUE , but the return value of the S-PLUS version is always visible.

The R version of this function does not include the paths argument.

SEE ALSO:

, ,

EXAMPLES:

# the default output will be similar to search(), but not include 
# the working database
.packages()
# list all available libraries and their full paths
.packages(all.available=T, paths=T)