with_dir: Working directory

with_dirR Documentation

Working directory

Description

Temporarily change the current working directory.

Usage

with_dir(new, code)

Arguments

new

⁠[character(1)]⁠
New working directory

code

[any]
Code to execute in the temporary environment

Value

[any]
The results of the evaluation of the code argument.

See Also

setwd()

Examples

getwd()

with_dir(tempdir(), getwd())

AnalyzeFMRI documentation built on Aug. 8, 2025, 7:16 p.m.