in_dir {xfun} | R Documentation |
Change the working directory, evaluate the expression, and restore the working directory.
in_dir(dir, expr)
dir |
Path to a directory. |
expr |
An R expression. |
library(xfun)
in_dir(tempdir(), {
print(getwd())
list.files()
})