libPaths {base} | R Documentation |
Search Paths for Packages
Description
.libPaths
gets/sets the library trees within which packages are
looked for.
Usage
.libPaths(new)
.Library
Arguments
new |
a character vector with the locations of R library trees. |
Details
.Library
is a character string giving the location of the
default library, the ‘library’ subdirectory of R\_HOME.
.libPaths
is used for getting or setting the library trees that
R knows about (and hence uses when looking for packages). If called
with argument new
, the library search path is set to
the existing files in unique(new, .Library)
and this is
returned. If given no argument, a character vector with the currently
known library trees is returned.
The library search path is initialized at startup from the environment
variable R\_LIBS (which should be a colon-separated list of
directories at which R library trees are rooted) by calling
.libPaths
with the directories specified in R\_LIBS.
Value
A character vector of file paths.
References
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth \& Brooks/Cole.
See Also
library
Examples
.libPaths() # all library trees R knows about