1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/libpaths.R
\name{with_libpaths}
\alias{with_libpaths}
\alias{local_libpaths}
\title{Library paths}
\usage{
with_libpaths(new, code, action = "replace")
local_libpaths(new = list(), action = "replace", .local_envir = parent.frame())
}
\arguments{
\item{new}{\verb{[character]}\cr New library paths}
\item{code}{\code{[any]}\cr Code to execute in the temporary environment}
\item{action}{\verb{[character(1)]}\cr should new values \code{"replace"}, \code{"prefix"} or
\code{"suffix"} existing paths.}
\item{.local_envir}{\verb{[environment]}\cr The environment to use for scoping.}
}
\value{
\code{[any]}\cr The results of the evaluation of the \code{code}
argument.
}
\description{
Temporarily change library paths.
}
\examples{
.libPaths()
new_lib <- tempfile()
dir.create(new_lib)
with_libpaths(new_lib, print(.libPaths()))
unlink(new_lib, recursive = TRUE)
}
\seealso{
\code{\link{withr}} for examples
\code{\link[=.libPaths]{.libPaths()}}
Other libpaths:
\code{\link{with_temp_libpaths}()}
}
\concept{libpaths}
|