lib_paths: Changing and viewing the package search paths

Description Usage Arguments Value Examples

View source: R/exported_functions.R

Description

View and edit the list of folders that R will look inside when trying to find a package. Add an existing folder, create and add a new folder, or shuffle a folder to the front of the list so that it is used as the default installation location for new packages in the current session.

Usage

1
lib_paths(path, make_path = TRUE, ask = TRUE)

Arguments

path

(Character, or omit) A path to add to the library search path. Can be an absolute or relative path. If path has more than one element, only the first one will be kept. Tilde expansion is performed on the input, but wildcard expansion (globbing) is not. If path is omitted, return the current library search path.

make_path

(Logical) If TRUE, create path's directory structure if it doesn't exist.

ask

(Logical) If TRUE, ask before creating path's directory structure if make_path = TRUE. Ignored if make_path = FALSE.

Value

A character vector of the folders on the library search path. If path was not omitted, it will be the first element.

Examples

1
2
3
4
5
6
7
8
lib_paths()

#> [1] "D:/R/R-3.5.2/library"

lib_paths(file.path(tempdir(), "newlibraryfolder"), ask = FALSE)

#> [1] "C:/Users/.../Temp/Rtmp0Qbvgo/newlibraryfolder"
#> [2] "D:/R/R-3.5.2/library"

librarian documentation built on May 2, 2019, 1:29 p.m.