generateReport
[Monolix - PKanalix] Generate report
Generate a project report with default options or from a custom Word template.
Usage
generateReport(
templateFile = NULL,
tablesStyle = NULL,
watermark = NULL,
reportFile = NULL
)
Arguments
- templateFile
[optional] (character) Path to the .docx template file used as reporting base. If not provided, a default report file is generated (as default option in the GUI).
- tablesStyle
[optional] (character)
- watermark
[optional] (list)
text (character)
fontFamily (character) ["Arial"]
fontSize (integer) [36]
color (vector) Rgb color [c(255, 0, 0)]
layout (character)
semiTransparent (logical) [true]
- reportFile
[optional] (list) If not provided, the report will be saved next to the project file with the name _report.docx.
nextToProject (logical) Generate report file next to project
path (character) Path (nextToProject == FALSE) or name (nextToProject == TRUE) of the generated report file
Details
Reports can be generated as in the GUI, either by using the default reporting or by using a custom template. Placeholders for tables can be used in the template, and they are replaced by result tables. It is not possible to replace plots placeholders with the connector, because this requires an interface to be open. If plots placeholders are present in the template, they will be replaced by nothing in the generated report.
Examples
if (FALSE) {
generateReport()
generateReport(templateFile = "/path/to/template.docx")
generateReport(templateFile = "/path/to/template.docx", tablesStyle = "Plain Table 1", watermark = list(text = "watermark", fontSize = 15))
}
# Working example to generate a default report ###
initializeLixoftConnectors("monolix")
loadProject(file.path(getDemoPath(),"1.creating_and_using_models","1.1.libraries_of_models","warfarinPK_project.mlxtran"))
runScenario()
reportPath = tempfile("report", fileext = ".docx")
generateReport(reportFile = list(nextToProject = FALSE, path = reportPath))
file.show(reportPath)
# Working example to generate a report with a custom template###
# Note that only tables get replaced. It is not possible to add plots to a report via connectors, but it can be done in the GUI.
initializeLixoftConnectors("pkanalix")
loadProject(file.path(getDemoPath(),"2.case_studies","project_aPCSK9_SAD.pkx"))
runScenario()
reportPath = tempfile("report", fileext = ".docx")
generateReport(templateFile = file.path(getDemoPath(),"2.case_studies","report_templates","PK_report_template_aPCSK9.docx"), reportFile = list(nextToProject = FALSE, path = reportPath))
file.show(reportPath)