with_dir: Run R code in temporary working directory.

Description Usage Arguments Value Examples

Description

Sometimes one might want to run R code with a temporary working directory in effect. This function will do that

Usage

1
with_dir(dir, expr)

Arguments

dir

Scalar string giving the desired temporary working directory.

expr

Expression to run with the temporary working directory in effect.

Value

Invisible NULL

Examples

1
with_dir(tempdir(), cat("Hello world!", file=tempfile(fileext=".txt")))

colinorourke/consortr documentation built on May 31, 2019, 11:42 p.m.