Chapter 13A. custom: reproducible plots and tables from any dataset
nlmx custom fills the space between a quick spreadsheet check and a purpose-built analysis command. It reads one delimited table, applies explicit data steps, and produces publication-sized plots or formatted tables with a log, machine-readable summary, and checksums. Use it when the variables already exist in a file but the precise view you need is not supplied by eda, fit, nca, vpc, or another dedicated command.
Novice promise
This chapter assumes no prior knowledge of ggplot2, data-frame manipulation, or clinical table programming. It explains the grain of a table, the difference between mapping and setting an aesthetic, why line and path are not interchangeable, how percentages get their denominators, and when a polished graphic can still be scientifically wrong.
Scope and evidence
Behavior was checked against docs/CUSTOM.md, the installed nlmx 4.5.0 executable, custom --list-plots, and the annotated .custom template. The guide describes 4.6.0, so this chapter avoids claiming features that were not reproduced with the available 4.5.0 binary.
pytools/ch13a_examples.py creates the deterministic evidence pack. Its main run reads 270 rows, creates BMI and log-DV columns, renders all 19 geoms in 19 named plots, and writes all six table kinds. Separate runs demonstrate a title line, a headerless file, a two-table NONMEM-style file, and a command-line-only plot. Results are preserved under documents/ch13a/results.
Thirty-six Markdown pages
The overview, complete command index, and 34 numbered pages cover:
- reading ordinary, titled, headerless, and NONMEM tables;
- the fixed preparation order and R-style expressions;
- every geom, aesthetic, facet, scale, summary, and export control;
- listing, summary, demographics, frequency, pivot, and correlation tables;
- settings precedence, output schemas, worked diagnostic/report packs, validation, and limitations.
Central rule
custom visualises and summarises columns. It does not fit a model, simulate a VPC, derive NCA parameters from profiles, join datasets, or establish causality. Begin every request by defining the row grain—record, observation, subject, occasion, or parameter row—and preserve that definition in the command or settings file.
Navigation
Start with the complete command index and first plot and table. Experienced users can jump to the geom families, table map, or validated worked pack.