libPaths                package:base                R Documentation

_S_e_a_r_c_h _P_a_t_h_s _f_o_r _P_a_c_k_a_g_e_s

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     .libPaths(new)

     .Library
     .Library.site

_A_r_g_u_m_e_n_t_s:

     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'.

_D_e_t_a_i_l_s:

     '.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.

     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) followed
     by those in environment variable 'R_LIBS_USER'.  Only directories
     which exist at the time will be included.

     By default 'R_LIBS' is unset, and 'R_LIBS_USER' is set to
     directory 'R/R.version$platform-library/x.y' of the home directory
     (or 'Library/R/x.y/library' for Mac OS X AQUA builds), for R
     x.y.z.

     '.Library.site' can be set via the environment variable 
     'R_LIBS_SITE' (as a colon-separated list of library trees).

     Both 'R_LIBS_USER' and 'R_LIBS_SITE' feature possible expansion of
     specifiers for R version specific information as part of the
     startup process.  The possible conversion specifiers all start
     with a '%' and are followed by a single letter (use '%%' to obtain
     '%'), with currently available conversion specifications as
     follows:

     '%_V' R version number including the patchlevel (e.g., '2.5.0').

     '%_v' R version number excluding the patchlevel (e.g., '2.5').

     '%_p' the platform for which R was built.

     '%_o' the underlying operating system.

     '%_a' the architecture (CPU) R was built on/for.

     (See 'version' for details on R version information.)

     Function '.libPaths' always uses the values of '.Library' and
     '.Library.site' in the base name space.  '.Library.site' can be
     set by the site in 'Rprofile.site', which should be followed by a
     call to '.libPaths(.libPaths())' to make use of the updated value.

_V_a_l_u_e:

     A character vector of file paths.

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     'library'

_E_x_a_m_p_l_e_s:

     .libPaths()                 # all library trees R knows about

