Internal Use Only Functions for Packages

DESCRIPTION:

These functions are for use in other S-PLUS functions.

USAGE:

.find.package(package=NULL, lib.loc=NULL, quiet=FALSE, verbose=FALSE)
.path.package(package=NULL, quiet=FALSE, verbose=FALSE)
.lib.loc(lib.loc=NULL, default.dirs=c("local/library", "library", "module"))
.libPaths(new)

OPTIONAL ARGUMENTS:

package
a character vector of package names.
lib.loc
a character vector describing the location of library directories to search through. The default value of 'NULL' corresponds to all libraries currently known. You can initialize lib.loc from getenv("S_LIBS") to set the list of locations where library sections (or packages) may be installed.
quiet
a logical value. If TRUE, the function returns quietly, no error message, if any of the packages are not found. If FALSE (the default), an error message is generated if any packages do not exist.
default.dirs
a character vector containing names of directories to search for packages.
new
a character vector containing the path to one or more directories containing packages (libraries).
verbose

VALUE:

a character vector of directory paths. See DETAILS for a description of the value returned by each function.

SIDE EFFECTS:

If the function .libPaths is called with a value for the new argument, then the value of the variable lib.loc that is stored in database 0 will be modifed. The lib.loc variable is used by functions library() and system.file().

DETAILS:

.find.package returns a character vector containing the paths to specified packages (libraries). The packages do not have to be attached. If the argument packages is NULL, then the vector contains all packages in known library and module directories.

.path.package returns a character vector containing the paths to specified packages (libraries) for the packages that are attached. If the argument packages is NULL, then the vector contains all packages that are attached.

.find.package and .path.package emulate R functions of the same name.

.libPaths returns a vector of directory names, and if new is supplied, it adds that directory to the list of places to look for libraries when using library() or system.file(). This function is similar to R's version, but R uses the variable .Library instead of lib.loc. See SIDE EFFECTS.

.lib.loc returns a character vector containing full paths to directories containing packages (libraries). The following values are combined to create the return value: the lib.loc argument, the current setting of the variable lib.loc from database 0, and the default S-PLUS library and module directories. This function is not in R.

SEE ALSO:

, , .

EXAMPLES:

# add another directory to those searched for packages
.libPaths("/homes/mc/my_packages")
# list directories that will be searched by library()
get("lib.loc",where=0)
# list full paths to all attached packages (libraries)
.path.package()