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())
[character(1)] New working directory
[character(1)]
[any] Code to execute in the temporary environment
[any]
[environment] The environment to use for scoping.
[environment]
[any] The results of the evaluation of the code argument.
code
withr for examples
withr
setwd()
# NOT RUN { getwd() with_dir(tempdir(), getwd()) # }
Run the code above in your browser using DataLab