tar_dir: Execute code in a temporary directory.

View source: R/tar_dir.R

tar_dirR Documentation

Execute code in a temporary directory.

Description

Runs code inside a new tempfile() directory in order to avoid writing to the user's file space. Used in examples and tests in order to comply with CRAN policies.

Usage

tar_dir(code)

Arguments

code

User-defined code.

Value

Return value of the user-defined code.

See Also

Other utilities to extend targets: tar_assert, tar_condition, tar_language, tar_test()

Examples

tar_dir(file.create("only_exists_in_tar_dir"))
file.exists("only_exists_in_tar_dir")

targets documentation built on Jan. 6, 2023, 5:16 p.m.