Renders a one-page clinical report to an editable Word document using
officer (with flextable when available) — no LaTeX
toolchain required. Called by renderClinicalReport for
format = "docx"; usable directly.
Arguments
- data
A report payload list (see
renderClinicalReport):subject,figures(a named list ofggplots),change(an optionalchange_annotation) andprovenance(an optional named list).- template
One of
"gait","hrv","emg"(drives the localized title).- lang
"en"or"ja".- out
Output
.docxpath.
Examples
# Writes an editable .docx via officer (a Suggests dependency) into tempdir().
if (requireNamespace("officer", quietly = TRUE)) {
fig <- plotNormativeBand(NULL, NormativeModel(
mean = sin(seq(0, pi, length.out = 101)), sd = rep(0.1, 101), time = 0:100))
out <- tempfile(fileext = ".docx")
buildDocxReport(list(subject = "P01", figures = list(gait_cycle = fig)),
template = "gait", out = out)
}