Render a clinical data review report.
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
)
String with path to the front page of the report.
(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.
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'.
(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.
String with path to the index file,
by default 'index.Rmd' in inputDir
.
String with input directory, working directory by default.
String with output directory, ('report' by default).
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.
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
.
Logical, if TRUE (FALSE by default)
messages during the execution of each report are not displayed
in the console (see render
).
Logical, if TRUE (FALSE by default) progress messages are printed during the report execution.
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
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 with parallel
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 the
nCores
parameter is specified.
checking if the associated Markdown
and rds
file
(list of Js dependencies) are available in intermediateDir
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 the
nCores
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.
see ? `clinDataReview-templates`
for a list of
clinical data template report available in the package.
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
parameter
specification 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)
Laure Cougnaud
Other clinical data reporting:
checkReportTitles()
,
forceParams()
,
getMdHeader()
,
getParamsFromConfig()
,
gitbook_clinDataReview_report()
,
html_clinDataReview_report()
,
knitPrintClinDataReview()
,
postProcessReport()