with_dir: Working directory

with_dirR Documentation

Working directory

Description

Temporarily change the current working directory.

Usage

with_dir(new, code)

local_dir(new = list(), .local_envir = parent.frame())

Arguments

new

⁠[character(1)]⁠
New working directory

code

[any]
Code to execute in the temporary environment

.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

setwd()

Examples

getwd()

with_dir(tempdir(), getwd())

withr documentation built on Oct. 28, 2024, 5:07 p.m.