Learn R Programming

drake (version 5.2.1)

drake_example: Save the source code files of a drake example.

Description

Copy a folder of code files for a drake example to the current working directory. Call drake_example("mtcars") to generate the code files from https://ropenscilabs.github.io/drake-manual/mtcars.html. To see the names of all the examples, run drake_examples().

Usage

drake_example(example = drake::drake_examples(), to = getwd(),
  destination = NULL, overwrite = FALSE)

Arguments

example

name of the example. To see all the available example names, run drake_examples().

to

Character scalar, file path, where to write the folder containing the code files for the example.

destination

Deprecated, use to instead.

overwrite

Logical, whether to overwrite an existing folder with the same name as the drake example.

Value

NULL

See Also

drake_examples(), make(), shell_file(), drake_batchtools_tmpl_file()

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine side effects.", {
drake_examples() # List all the drake examples.
# Sets up the same example as https://ropenscilabs.github.io/drake-manual/mtcars.html # nolint
drake_example("mtcars")
# Sets up the SLURM example.
drake_example("slurm")
})
# }

Run the code above in your browser using DataLab