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
|
configDir |
String with directory with config files,
by default a 'config' folder in |
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 |
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 |
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 |
quiet |
Logical, if TRUE (FALSE by default)
messages during the execution of each report are not displayed
in the console (see |
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:
|
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:
specification of chapter-specific input parameters, specified in YAML configuration files
(optional) creation of each chapter in parallel if
nCores
> 1. In that case, all chapters are run in parallel, excepted the chapter(s) run internally in parallel (config file withparallel
set to 'TRUE').(optional) split of each chapter into html file specific for each chapter, by specifying the
split_by
parameter in the chapter-specific config file
This consists of:
importing the general config file ('config'.yml) to identify each report of interest ('config' tag)
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 thenCores
parameter is specified.
checking if the associated
Markdown
andrds
file (list of Js dependencies) are available inintermediateDir
split each chapter into separated Markdown documents, based on the
split_by
parameter (specified at the report or config level)conversion of each Markdown document to an HTML document.
This step is parallelized across the different Markdown documents, if thenCores
parameter is specified.build the book:
creation of a common TOC for the book
inclusion of the TOC in each Markdown file
update of the section number in each chapter
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:
chapter-specific split, specified in the configuration file of the specific chapter, via the
split_by
parameterspecification as a number (if specified within a config file), e.g. '0' for no split, 1' for chapter, '2' for section, '3' for subsection, ...
split at section level higher than 2 (until 7) (if specified within a config file)
Author(s)
Laure Cougnaud
See Also
Other clinical data reporting:
checkReportTitles()
,
forceParams()
,
getMdHeader()
,
getParamsFromConfig()
,
gitbook_clinDataReview_report()
,
html_clinDataReview_report()
,
knitPrintClinDataReview()
,
postProcessReport()