Export the example Makefile supplied with dnaEPICO to a user directory.

extractMake(destDir, overwrite = FALSE)

Arguments

destDir

Character. Destination directory for the Makefile.

overwrite

Logical. Whether to overwrite an existing Makefile in destDir. The default is FALSE.

Value

Character scalar containing the path to the copied Makefile.

Details

The exported workflow requires GNU Make 4.3 or later. When the Makefile is created, extractMake() records the absolute path to the Rscript executable from the current R installation in the RSCRIPT Make variable. This value can be overridden when running Make, for example make f4 RSCRIPT=/path/to/Rscript, when another R installation or an HPC module should be used.

Quarto is required only for targets that render reports. The rules use relative project paths and support project directories containing spaces. GNU Make and Quarto are not required to install or load dnaEPICO.

Examples

tmp <- file.path(tempdir(), "dnaEPICO-make-example")
dir.create(tmp, recursive = TRUE, showWarnings = FALSE)
makefile_path <- extractMake(
    destDir = tmp,
    overwrite = TRUE
)
stopifnot(file.exists(makefile_path))