drake_script: Write an example _drake.R script to the current working...

View source: R/drake_script.R

drake_scriptR 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)

drake documentation built on Nov. 6, 2023, 5:09 p.m.