powered by
Temporarily change library paths.
with_libpaths(new, code, action = "replace")local_libpaths(new = list(), action = "replace", .local_envir = parent.frame())
local_libpaths(new = list(), action = "replace", .local_envir = parent.frame())
[character] New library paths
[character]
[any] Code to execute in the temporary environment
[any]
[character(1)] should new values "replace", "prefix" or "suffix" existing paths.
[character(1)]
"replace"
"prefix"
"suffix"
[environment] The environment to use for scoping.
[environment]
[any] The results of the evaluation of the code argument.
code
withr for examples
withr
.libPaths()
Other libpaths: with_temp_libpaths()
with_temp_libpaths()
# NOT RUN { .libPaths() new_lib <- tempfile() dir.create(new_lib) with_libpaths(new_lib, print(.libPaths())) unlink(new_lib, recursive = TRUE) # }
Run the code above in your browser using DataLab