Ensure that all modules referenced in the analysis specifications are instantiated locally in the folder specified in the INSTANTIATED_MODULES_FOLDER environmental variable.

Missing modules will be fetched from remote repositories.

This function will also check whether there are different versions of the same module specified, which is not allowed, and whether all modules required by the specified modules are also instantiated.

ensureAllModulesInstantiated(
  analysisSpecifications,
  forceVerification = FALSE,
  enforceModuleDependencies = TRUE
)

Arguments

analysisSpecifications

An object of type AnalysisSpecifications as created by createEmptyAnalysisSpecificiations().

forceVerification

When set to TRUE, the verification process is forced to re-evaluate if a module is properly installed. The default is FALSE since if a module is successfully validated, the module will contain the hash value of the module's renv.lock file in the file system so it can by-pass running this check every time.

enforceModuleDependencies

When set to TRUE, Strategus will enforce module dependencies that are declared by each module. For example, the CohortDiagnostics module declares a dependency on the CohortGenerator module and Strategus will require that an analysis specification declare that both modules must exist in order to execute the analysis. When set to FALSE, Strategus will not enforce these module dependencies which assumes you have properly run all module dependencies yourself. Setting this to FALSE is not recommended since it is potentially unsafe.

Value

A list containing the install status of all modules (TRUE if all are installed properly) and a tibble listing the instantiated modules.