Learn R Programming

targets (version 0.0.0.9000)

tar_dir: Execute code in a temporary directory.

Description

Creates a new directory at tempfile() and runs code inside with withr::with_dir()

Usage

tar_dir(code)

Arguments

code

User-defined code.

Value

Return value of the user-defined code.

Examples

Run this code
# NOT RUN {
tar_dir(file.create("x"))
file.exists("x") # Should be false.
# }

Run the code above in your browser using DataLab