% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deprecated.R
\name{expose_imports}
\alias{expose_imports}
\title{Deprecated: expose package functions and objects for
analysis with drake.
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}}
\usage{
expose_imports(
  package,
  character_only = FALSE,
  envir = parent.frame(),
  jobs = 1
)
}
\arguments{
\item{package}{Name of the package, either a symbol or a string,
depending on \code{character_only}.}

\item{character_only}{Logical, whether to interpret \code{package}
as a character string or a symbol (quoted vs unquoted).}

\item{envir}{Environment to load the exposed package imports.
You will later pass this \code{envir} to \code{\link[=make]{make()}}.}

\item{jobs}{Number of parallel jobs for the parallel processing
of the imports.}
}
\value{
The environment that the exposed imports are loaded into.
Defaults to your R workspace.
}
\description{
Deprecated on 2020-06-24.
}
\details{
Deprecated. This function assigns the objects and functions
from the package environment to the user's environment (usually global)
so \code{drake} can watch them for changes. This used to be the standard
way to make \code{drake} compatible with workflows implemented as custom
analysis packages. Now, the recommendation is to supply
\code{getNamespace("yourPackage")} to the \code{envir} argument of \code{\link[=make]{make()}}
and friends. Read \verb{https://github.com/ropensci/drake/issues/1286},
especially \verb{https://github.com/ropensci/drake/issues/1286#issuecomment-649088321}, # nolint
for details.
}
\examples{
# nolint start
\dontrun{
isolate_example("contain side effects", {
# Consider a simple plan that depends on the biglm package.
# library(biglm)
plan <- drake_plan(model = biglm(y ~ x, data = huge_dataset))
# Even if you load the biglm package, drake still ignores
# the biglm() function as a dependency. The function is missing
# from the graph:
# vis_drake_graph(plan)
# And if you install an updated version of biglm with a revised
# biglm() function, this will not cause drake::make(plan)
# to rerun the model.
# This is because biglm() is not in your environment.
# ls()
# biglm() exists in its own special package environment,
# which drake does not scan.
# ls("package:biglm")
# To depend on biglm(), use expose_imports(biglm)
# to bring the objects and functions in biglm into
# your own (non-package) environment.
# expose_imports(biglm)
# Now, the biglm() function should be in your environment.
# ls()
# biglm() now appears in the graph.
# vis_drake_graph(plan)
# And subsequent make()s respond to changes to biglm()
# and its dependencies.
})
}
# nolint end
}
\keyword{internal}
