| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/utils.R |
| 3 |
\name{in_dir} |
| 4 |
\alias{in_dir} |
| 5 |
\title{Evaluate an expression under a specified working directory} |
| 6 |
\usage{ |
| 7 |
in_dir(dir, expr) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{dir}{Path to a directory.} |
| 11 |
|
| 12 |
\item{expr}{An R expression.} |
| 13 |
} |
| 14 |
\description{ |
| 15 |
Change the working directory, evaluate the expression, and restore the |
| 16 |
working directory. |
| 17 |
} |
| 18 |
\examples{ |
| 19 |
library(xfun) |
| 20 |
in_dir(tempdir(), { |
| 21 |
print(getwd()) |
| 22 |
list.files() |
| 23 |
}) |
| 24 |
} |