build_master() reads a given folder structure, which contains scripts, and builds
a master file. The file which gets written depends on the selected layout.
Arguments
- dir
The folder structure which contains the scripts to build upon.
- master_name
The file name which should be written.
Authors name to be put in the header.
- layout
The layout which should be written to the master file. Available are:
"compact": The header and rebuilt master section followed by one script block which runs all scripts. (default)
"full": The whole folder structure with an overview, a section which runs all scripts and single blocks for every folder and script.
See also
RStudio helper functions: run_script(), run_folder(), run_project(),
run_project_parallel()
Examples
# Example export file paths
# NOTE: These tempfiles are only for the examples. In reality you just call the
# main function and put in your desired path and name directly.
temp_file <- tempfile(fileext = ".Rmd")
# Example master
build_master(dir = dirname(temp_file),
master_name = basename(temp_file))
# Example compact master
build_master(dir = dirname(temp_file),
master_name = basename(temp_file),
layout = "full")
# Manual cleanup for example
unlink(temp_file)
