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.

tar_dir(code)

Arguments

code

User-defined code.

Value

Return value of the user-defined code.

See also

Other targetopia: tar_test()

Examples

tar_dir(file.create("only_exists_in_tar_dir"))
#> [1] TRUE
file.exists("only_exists_in_tar_dir")
#> [1] FALSE