Appendix C — The rgtlab Software

NoteWhy this appendix exists

Several chapters use tools written in the author’s lab. A reader is entitled to know what those tools are, what they depend on, and how much of the book’s argument rests on them. This appendix is the inventory.

It exists partly as a disclosure. A textbook that teaches its author’s own software has an obvious conflict. The honest response, in our view, is to make the extent of it visible in one place.

C.1 What the book depends on, and what it does not

The chapters were written so that a reader with none of this software installed can still do the work. Every technique the book teaches has a portable expression. That is, renv, Docker, Quarto, Git, and the tidyverse are the substance, and the tools below are conveniences built on them.

There are two exceptions. Chapter 11 is about zzcollab and cannot be separated from it, though its Five Pillars framing applies to any compendium. The two case studies (Chapter 30, Chapter 31) use zztable1 and zzlongplot for table and figure production. A reader without them should substitute gtsummary and plain ggplot2. Nothing in the analyses depends on the substitution.

Everything else is optional. Our aim is that wherever a chapter mentions one of these tools, it also names the portable alternative. A reader who ignores the tool then loses convenience rather than capability. Not every chapter meets that standard yet, and we plan to bring the rest into line.

C.2 Research infrastructure

zzcollab (github.com/rgt47/zzcollab). A Docker-based research collaboration framework. Composes rrtools-style compendium layout, renv, and containers into one command-line workflow with profile-based project scaffolding. Treated at length in Chapter 11.

zzrenvcheck (github.com/rgt47/zzrenvcheck). Checks that packages used in source code are declared in DESCRIPTION, and, separately, that DESCRIPTION and renv.lock agree. By default it does not compare the code directly against the lockfile, and it does not follow indirect dependencies. It can therefore report success on a project that renv::status() would still flag. It complements renv as a quick, declaration-only check that needs no container or installed environment. However, renv::status() remains the authority before a release. Used in Chapter 9.

zzgit (github.com/rgt47/zzgit). A zsh plugin replacing the git add . && git commit -am reflex with an interactive stage-and-commit: a Conventional Commits wizard and a confirmation before pushing to a protected branch. Secret scanning of the staged diff requires gitleaks to be installed separately. Without it, only a filename heuristic runs, and that heuristic will not catch a secret’s contents. Discussed in Chapter 7.

zzvim-R (github.com/rgt47/zzvim-R). A Vim and Neovim plugin linking the editor to an embedded R terminal: send a line, a visual selection, or a Quarto chunk, and render the document without leaving the editor. Mentioned in Chapter 6.

C.3 Reporting and presentation

zztable1 (github.com/rgt47/zztable1). Publication-quality summary tables with automatic format detection for LaTeX and HTML. Its counts, percentages, means, and p-values agree with gtsummary. However, as of this writing it leaves the missing-value row blank instead of reporting the count. A table with missing data should therefore use gtsummary until that is fixed. The portable alternative is gtsummary. Mentioned in both case studies.

zzlongplot (github.com/rgt47/zzlongplot). Longitudinal plots with grouping, change scores, and faceting, including CDISC-oriented regulatory themes. The portable alternative is ggplot2 with stat_summary, which Chapter 20 shows explicitly. Used in Chapter 31.

zzobj2fig (github.com/rgt47/zzobj2fig). Generates LaTeX tables from data frames and statistical objects, and crops them to standalone PDF figures. Carries journal themes (APA, Nature, NEJM) and S3 methods for lm and glm. Its main entry point is o2f(). Table cells match summary(lm) and kableExtra. However, as of this writing it mangles some column headers in LaTeX output (for example, rendering Std. Error as Std\_\_Error). Check the headers before using generated output as-is. Version 0.4.0, GitHub-only, with a single maintainer.

C.4 Statistical methods

zzpower (github.com/rgt47/zzpower). An interactive Shiny power and sample-size calculator across two-group, paired, one-sample, two-proportion, and correlation designs, with power curves and downloadable reports. Its answers are close to power.prop.test and pwr but not identical, because it uses a different approximation. Cross-check with base R, as Chapter 26 does. There are two traps as of this writing. Omitting the second proportion silently substitutes a default rather than raising an error, and the default dropout adjustment returns a fractional sample size. Used in Chapter 26.

nof1power (github.com/rgt47/nof1power). An early-stage scaffold for power analysis and Monte Carlo simulation for N-of-1 crossover trials, a design Chapter 26 does not otherwise treat. As of this writing it exports no functions; the design is not yet implemented. Itself built as a zzcollab compendium.

zzmesoimpute (github.com/rgt47/zzmesoimpute). Imputation for left-censored, below-detection-limit concentrations from multiplexed immunoassays, with a common interface across substitution, uniform draw, regression-on-order-statistics, censored maximum likelihood, and multiple imputation. Discussed in Chapter 21, where the point is that left censoring is not missingness.

zzfisher (github.com/rgt47/zzfisher). Fisher’s exact test for \(r \times 2\) contingency tables, with tree-based and network-based algorithms implemented in R, C, and C++. Relevant to the sparse-table case Chapter 12 uses as its example of a plausibly-wrong statistic.

C.5 Domain and data collection

zzedc (github.com/rgt47/zzedc). A Shiny electronic data capture system for clinical trials: authentication, entry forms, quality-control reports, and export. The setting Chapter 13 describes when it says clinical data usually arrive from a capture system rather than as a file. As of this writing, its ‘encrypted’ database stores data in a plain SQLite file. Its audit trail can also be rewritten, by anyone with write access to the database, so that it passes its own integrity check. Neither functions as a control yet. No validation package or Validation Master Plan exists for it. Do not cite it as an example of 21 CFR Part 11 compliance.

zzworld (github.com/rgt47/zzworld). Scoring for the WORLD item in cognitive assessment, computing edit distance between a response and the target word and integrating with MMSE totals. Narrow by design. No chapter uses it; it is listed for completeness.

C.6 A caution about depending on any of it

None of these packages is on CRAN. They are installed from GitHub, they carry version numbers that reflect active development rather than stability, and several are below version 1.0. The reproducibility argument of Chapter 9 applies to them with more force than it does to CRAN packages. Pin them by commit in renv.lock. An analysis that depends on an unpinned in-house package should be expected not to reproduce in two years.

The same caution should temper how much of your own workflow you build on any lab’s internal tooling, including this one. The portable core is what survives a change of institution.