libPaths
Search Paths for Packages

Description

.libPaths() lists or sets the paths containing packages.

Usage

.libPaths(new)
base::.Library
base::.Library.site

Arguments

new a character vector naming libraries (directories in which the library function will search for add-on packages).

Details

If new is supplied, then character strings in new are passed through normalizePath to convert relative paths to absolute paths and to convert a possible initial tilde to the user's home directory. Entries which to not name existing directories are dropped. The package search path is then changed to unique(c(new, base::.Library.site, base::.Library)) and that new list of libraries is returned from the function.
If new is not supplied, the search path is not changed and .libPaths() returns the current list of libraries.
.Library is a character string specifying the path of the default library (which is R.home("library")).
.Library.site is a character vector specifying the locations of site-specific libraries. Its default value, set when TIBCO Enterprise Runtime for R starts a session, is R.home("site-library"), but it may be overridden by setting the environment variable TERR_LIBS_SITE to a colon-separated (on Linux) or semicolon-separated (on Windows) list of directories before starting TIBCO Enterprise Runtime for R. Directories that do not exist at startup time are silently omitted from .Library.site.
Neither .Library nor .Library.site may be changed after a TIBCO Enterprise Runtime for R session starts.
When TIBCO Enterprise Runtime for R starts a session, it uses the values of Sys.getenv("TERR_LIBS") and Sys.getenv("TERR_LIBS_USER") (treated as colon/semicolon-separated lists of directories) in a call to .libPaths(). TERR_LIBS_USER should be considered a user-specific list of libraries for the current platform and version of TIBCO Enterprise Runtime for R and it has the default value .expand_R_libs_env_var("\~/TERR/%p-library/%v"). TERR_LIBS should be considered as a session-specific list of libraries and it has no default value.
Value
a character vector of library directories in which TIBCO Enterprise Runtime for R will search for packages.
Side Effects
If the function .libPaths is called with a value for the new argument, the library search path will be updated so that subsequent calls to library or require will look in new places for packages.
Examples
# list libraries.
.libPaths()
# add "~/packages" to front of list of libraries, if it names a directory.
.libPaths(c("~/packages", .libPaths()))
Package base version 4.0.0-28
Package Index