% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/drake_script.R
\name{drake_script}
\alias{drake_script}
\title{Write an example \verb{_drake.R} script to the current working directory.}
\usage{
drake_script(code = NULL)
}
\arguments{
\item{code}{R code to put in \verb{_drake.R} in the current working directory.
If \code{NULL}, an example script is written.}
}
\value{
Nothing.
}
\description{
A \verb{_drake.R} file is required for \code{\link[=r_make]{r_make()}} and friends.
See the \code{\link[=r_make]{r_make()}} help file for details.
}
\examples{
\dontrun{
isolate_example("contain side-effects", {
drake_script({
  library(drake)
  plan <- drake_plan(x = 1)
  drake_config(plan, lock_cache = FALSE)
})
cat(readLines("_drake.R"), sep = "\n")
r_make()
})
}
}
