R/dir.R

#' @include with_.R
NULL

# working directory ----------------------------------------------------------

#' Working directory
#'
#' Temporarily change the current working directory.
#'
#' @template with
#' @param new `[character(1)]`\cr New working directory
#' @inheritParams with_collate
#' @seealso [setwd()]
#' @export
#' @examples
#' getwd()
#'
#' with_dir(tempdir(), getwd())
with_dir <- with_(setwd)

#' @rdname with_dir
#' @export
local_dir <- local_(setwd)

Try the withr package in your browser

Any scripts or data that you put into this service are public.

withr documentation built on Nov. 2, 2023, 5:24 p.m.