powered by
Temporarily change the current working directory.
with_dir(new, code)local_dir(new = list(), .local_envir = parent.frame())
local_dir(new = list(), .local_envir = parent.frame())
[any] The results of the evaluation of the code
[any]
code
argument.
[character(1)] New working directory
[character(1)]
[any] Code to execute in the temporary environment
[environment] The environment to use for scoping.
[environment]
withr for examples
withr
setwd()
getwd() with_dir(tempdir(), getwd())
Run the code above in your browser using DataLab