drake_script {drake}R Documentation

Write an example ⁠_drake.R⁠ script to the current working directory.

Description

A ⁠_drake.R⁠ file is required for r_make() and friends. See the r_make() help file for details.

Usage

drake_script(code = NULL)

Arguments

code

R code to put in ⁠_drake.R⁠ in the current working directory. If NULL, an example script is written.

Value

Nothing.

Examples

## Not run: 
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()
})

## End(Not run)

[Package drake version 7.13.10 Index]