Reads a NONMEM output table (space/tab-delimited, possibly with repeated headers and multiple "TABLE NO." blocks), keeps the observation rows, and builds the standard goodness-of-fit diagnostics: observed vs predictions and residual plots (CWRES / NPDE / IWRES). Plots are only built when the required columns are present. Optionally writes all plots to a Word (.docx) file in the analysis directory.
Arguments
- file
Path to a NONMEM table file, OR a run directory (.reg / .nm7 / any folder) inside which a NONMEM table is auto-detected. Since the table is not necessarily named "sdtab", detection is by content ("TABLE NO." header), optionally filtered by
stem.- pred
Preference for the population prediction column used on x-axes. The first available name is used. Default
c("PRED","CPRED"). Pass e.g.pred = "CPRED"to force one.- time
Preference for the time column used on residual-vs-time plots. Default
c("TIME","TAD").- by
Optional character vector of column names for faceting (
facet_wrap), e.g.c("SEX","CMT").- loess
Add a loess trend (default TRUE).
- reg
Add a linear regression (default TRUE).
- se
Show confidence band around the linear regression (default FALSE).
- alpha
Point transparency (default 0.5).
- log_pred
Log10 axes for the DV-vs-prediction plots (default FALSE).
- stem
Optional filename stem to disambiguate auto-detection in a run directory (e.g. "sdtab", "patab"). Not required to be "sdtab".
- save_docx
If TRUE, write all plots to a .docx in the analysis directory (default FALSE).
- output_file
Output .docx path. If NULL and
save_docx=TRUE, a name is derived from the table file, written next to it. (Formerlydocx_file, still accepted with a warning.)- width, height, dpi
Image size (inches) and resolution for the docx export.
- ...
Former argument name, accepted with a warning until version 1.0.