ID EN
Miscellaneous

libPaths

R Base 3.6.2

.libPaths gets/sets the library trees within which packages are looked for.

Syntax

R
.libPaths(new)<p></p><p>.Library
.Library.site</p>

Arguments

Parameter Description
new a character vector with the locations of R library trees. Tilde expansion (path.expand) is done, and if any element contains one of *?[, globbing is done where supported by the platform: see Sys.glob.

Return Value

A character vector of file paths.

Details

.Library is a character string giving the location of the default library, the library subdirectory of R_HOME. .Library.site is a (possibly empty) character vector giving the locations of the site libraries, by default the site-library subdirectory of R_HOME (which may not exist). .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 directories in unique(c(new, .Library.site, .Library)) and this is returned. If given no argument, a character vector with the currently active library trees is returned. How paths new with a trailing slash are treated is OS-dependent. On a POSIX filesystem existing directories can usually be specified with a trailing

Examples

Example
R
# NOT RUN {
.libPaths()                 # all library trees R knows about
# }

See Also

library