with_libpaths: Library paths

Description Usage Arguments Value See Also Examples

Description

Temporarily change library paths.

Usage

1
2
3
with_libpaths(new, code, action = "replace")

local_libpaths(new, action = "replace", .local_envir = parent.frame())

Arguments

new

[character]
New library paths

code

[any]
Code to execute in the temporary environment

action

[character(1)]
should new values "replace", "prefix" or "suffix" existing paths.

.local_envir

[environment]
The environment to use for scoping.

Value

[any]
The results of the evaluation of the code argument.

See Also

withr for examples

.libPaths()

Other libpaths: with_temp_libpaths()

Examples

1
2
3
4
5
.libPaths()
new_lib <- tempfile()
dir.create(new_lib)
with_libpaths(new_lib, print(.libPaths()))
unlink(new_lib, recursive = TRUE)

withr documentation built on April 21, 2020, 1:11 a.m.