render_clinDataReviewReport {clinDataReview}R Documentation

Render a clinical data review report.

Description

Render a clinical data review report.

Usage

render_clinDataReviewReport(
  configFiles = NULL,
  configDir = file.path(inputDir, "config"),
  logFile = NULL,
  indexPath = file.path(inputDir, "index.Rmd"),
  inputDir = ".",
  outputDir = "./report",
  intermediateDir = "./interim",
  extraDirs = getExtraDirs(inputDir = inputDir, configDir = configDir),
  quiet = FALSE,
  verbose = TRUE,
  nCores = 1
)

Arguments

configFiles

(optional) Character vector with specific config files to be converted from Rmarkdown to Markdown. If

  • not specified (by default): all config files specified in the general 'config.yml' will be run (Rmd -> md)

  • specified (expert use only): only the specified files will be run (Rmd -> md). Other config files mentioned in the general 'config.yml' file won't be rerun, so the associated 'md' file should be already available in the intermediateDir folder.

configDir

String with directory with config files, by default a 'config' folder in inputDir.
It should contain a general 'config.yml' file and dedicated 'config-[X].yml' for each chapter. The order of each chapter is specified in the 'config' slot in the general general 'config.yml'.

logFile

(optional) String with path to a log file, where output (also error/messages/warnings) should be stored. If specified, the entire output is re-directed to this file.

indexPath

String with path to the index file, by default 'index.Rmd' in inputDir.

inputDir

String with input directory, working directory by default.

outputDir

String with output directory, ('report' by default).

intermediateDir

String with intermediate directory ('interim' by default), where markdown files and rds file specifying Js libraries (with knit_meta) for each sub report are stored.

extraDirs

Character vector with extra directories required by the report, directory with external images. By default, the directories: 'figures', 'tables' and mentioned in the 'patientProfilePath' parameter of the general config file are included. All these folders should be available in inputDir.

quiet

Logical, if TRUE (FALSE by default) messages during the execution of each report are not displayed in the console (see render).

verbose

Logical, if TRUE (FALSE by default) progress messages are printed during the report execution.

nCores

Integer containing the number of cores used to render the report (1 by default). If more than 1, two steps of the report creation are run in parallel across chapters:

  • the rendering of the Rmarkdown file to Markdown

  • the conversion from Markdown to HTML

Value

String with path to the front page of the report.

Process

This function is based on the render_book function, with the extra functionalities:

This consists of:

  1. importing the general config file ('config'.yml) to identify each report of interest ('config' tag)

  2. for each report of interest:

    • loading the report specific parameters from the associated 'config' file (see the getParamsFromConfig function)

    • if the template should be extracted from a specified package (templatePackage tag), this template is copied to the current directory. Please note that if a file with same name is available in the working directory, this file will be overwritten.

    • running the report ('template' tag) with the associated parameters in a new R session for reproducibility, to obtain the associated Markdown file.
      This step is parallelized across the different config files, if the nCores parameter is specified.

  3. checking if the associated Markdown and rds file (list of Js dependencies) are available in intermediateDir

  4. split each chapter into separated Markdown documents, based on the split_by parameter (specified at the report or config level)

  5. conversion of each Markdown document to an HTML document.
    This step is parallelized across the different Markdown documents, if the nCores parameter is specified.

  6. build the book:

    1. creation of a common TOC for the book

    2. inclusion of the TOC in each Markdown file

    3. update of the section number in each chapter

    4. inclusion of the section number in each HTML file name

If the execution of a specific report fails with error, a warning message is triggered. A report containing only the specified title is created, to ensure output consistency (especially html file numbering) in case the report succeeds.

Available template report

see ? `clinDataReview-templates` for a list of clinical data template report available in the package.

Extension to chapter-specific split

The bookdown 'split_by' parameter is extended, to support:

Author(s)

Laure Cougnaud

See Also

Other clinical data reporting: checkReportTitles(), forceParams(), getMdHeader(), getParamsFromConfig(), gitbook_clinDataReview_report(), html_clinDataReview_report(), knitPrintClinDataReview(), postProcessReport()


[Package clinDataReview version 1.5.0 Index]