Learn R Programming

drake (version 6.1.0)

load_main_example: Load the main example from drake_example("main")

Description

The main example itself lives at https://github.com/wlandau/drake-examples/tree/master/main. # nolint Use drake_example("main") to download the code. The chapter of the user manual at https://ropenscilabs.github.io/drake-manual/main.html # nolint also walks through the main example. This function also writes/overwrites the files report.Rmd and raw_data.xlsx.

Usage

load_main_example(envir = parent.frame(), report_file = "report.Rmd",
  overwrite = FALSE, force = FALSE)

Arguments

envir

The environment to load the example into. Defaults to your workspace. For an insulated workspace, set envir = new.env(parent = globalenv()).

report_file

where to write the report file report.Rmd.

overwrite

logical, whether to overwrite an existing file report.Rmd

force

logical, whether to force the loading of a non-back-compatible cache from a previous version of drake.

Value

A drake_config() configuration list.

See Also

clean_main_example()

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine side effects.", {
if (requireNamespace("downloader")){
# Populate your workspace and write 'report.Rmd' and 'raw_data.xlsx'.
load_main_example() # Get the code: drake_example("main")
# Run the project with make(plan).
# Make sure you have these packages installed first:
# dplyr, forcats, ggplot2, readxl, and rmarkdown
make(plan) # Build the targets.
readd(hist) # Show the ggplot2 histogram.
# Clean up the example.
clean_main_example()
}
})
# }

Run the code above in your browser using DataLab