% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/with_package.R
\name{with_package}
\alias{with_package}
\title{Execute code with a modified search path}
\usage{
with_package(package, code, ...)
}
\arguments{
\item{package}{(\code{character(1)})\cr
Name of the package to attach.}

\item{code}{(\code{expression})\cr
Code to run.}

\item{...}{(\code{any})\cr
Additional arguments passed to \code{\link[=library]{library()}}.}
}
\value{
Result of the evaluation of \code{code}.
}
\description{
Attaches a package to the search path (if not already attached), executes code and
eventually removes the package from the search path again, restoring the previous state.

Note that this function is deprecated in favor of the (now fixed) version in \CRANpkg{withr}.
}
\seealso{
\CRANpkg{withr} package.
}
