Learn R Programming

targets (version 1.7.1)

tar_dir: Execute code in a temporary directory.

Description

Not a user-side function. Just for CRAN.

Usage

tar_dir(code)

Value

Return value of the user-defined code.

Arguments

code

User-defined code.

Details

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.

Examples

Run this code
tar_dir(file.create("only_exists_in_tar_dir"))
file.exists("only_exists_in_tar_dir")

Run the code above in your browser using DataLab