| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/dir.R |
| 3 |
\name{with_dir} |
| 4 |
\alias{with_dir} |
| 5 |
\alias{local_dir} |
| 6 |
\title{Working directory} |
| 7 |
\usage{ |
| 8 |
with_dir(new, code) |
| 9 |
|
| 10 |
local_dir(new = list(), .local_envir = parent.frame()) |
| 11 |
} |
| 12 |
\arguments{ |
| 13 |
\item{new}{\verb{[character(1)]}\cr New working directory} |
| 14 |
|
| 15 |
\item{code}{\code{[any]}\cr Code to execute in the temporary environment} |
| 16 |
|
| 17 |
\item{.local_envir}{\verb{[environment]}\cr The environment to use for scoping.} |
| 18 |
} |
| 19 |
\value{ |
| 20 |
\code{[any]}\cr The results of the evaluation of the \code{code} |
| 21 |
argument. |
| 22 |
} |
| 23 |
\description{ |
| 24 |
Temporarily change the current working directory. |
| 25 |
} |
| 26 |
\examples{ |
| 27 |
getwd() |
| 28 |
|
| 29 |
with_dir(tempdir(), getwd()) |
| 30 |
} |
| 31 |
\seealso{ |
| 32 |
\code{\link{withr}} for examples |
| 33 |
|
| 34 |
\code{\link[=setwd]{setwd()}} |
| 35 |
} |