Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

add_lib

Adding Package Libraries


Description

Prepend/append paths to the library path list, using .libPaths.

Usage

add_lib(..., append = FALSE)

Arguments

...

paths to add to .libPath

append

logical that indicates that the paths should be appended rather than prepended.

Details

This function is meant to be more convenient than .libPaths, which requires more writing if one wants to:

  • sequentially add libraries;

  • append and not prepend new path(s);

  • keep the standard user library in the search path.

Examples

ol <- .libPaths()
# called sequentially, .libPaths only add the last library
show( .libPaths('.') )
show( .libPaths(tempdir()) )
# restore
.libPaths(ol)

# .libPaths does not keep the standard user library
show( .libPaths() ) 
show( .libPaths('.') )
# restore
.libPaths(ol)

# with add_lib
show( add_lib('.') )
show( add_lib(tempdir()) )
show( add_lib('..', append=TRUE) )

# restore 
.libPaths(ol)

pkgmaker

Development Utilities for R Packages

v0.32.2
GPL (>= 2)
Authors
Renaud Gaujoux [aut, cre]
Initial release
2020-10-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.