library(ggplot2)
library(hvtiPlotR) # house plots, themes, and PPT/PDF export
library(hvtiRutilities) # data dictionaries, labels, manifests
library(gt) # publication tables
library(patchwork) # compose multi-panel figures2 Packages
A short stack does most of the work in this book. ggplot2 (Wickham et al. 2026) is the foundation; everything else either builds figures on top of it or supplies the modeling output we plot.
What each one is for:
- hvtiPlotR (Ehrlinger 2026b): the core of the book. It wraps the figures we publish into a two-step API: an
hv_*()constructor validates the data and returns an object, andplot()turns that object into a bare ggplot. It also carries the house themes (theme_hv_manuscript(),theme_hv_poster(), the PowerPoint themes) and the save helpers. - hvtiRutilities (Ehrlinger 2026c): the data-governance side: data dictionaries, variable labels, dataset manifests, and the synthetic-data generators we use so the examples run without touching real patient data.
- ggRandomForests (Ehrlinger 2026a), randomForestSRC (Ishwaran and Kogalur 2026; Ishwaran and Kogalur 2007; Ishwaran et al. 2008), and varPro (Lu et al. 2026): the random-forest stack.
randomForestSRCfits the forest,varProdoes variable selection, andggRandomForeststurns either one into a ggplot. These load in the random forest chapters where they are used. - TemporalHazard (Ehrlinger 2026d): our R port of the SAS/C HAZARD module, for parametric and nonparametric hazard modeling. It loads in its own chapter.
- gt (Iannone et al. 2026): publication-quality tables. We use it directly for now; a companion
hvtiRtablespackage is planned to give tables the same house treatment the plots get. - patchwork (Pedersen 2025): composes several plots into one figure with shared labels and panel tags.
- survival (Therneau 2026; Terry M. Therneau and Patricia M. Grambsch 2000): the
Surv()objects and Kaplan-Meier machinery underneath the survival figures. - mlbench (Leisch and Dimitriadou 2026): example data only — the ROC chapter borrows its Pima Indians diabetes set for a classification forest that discriminates well enough to draw a ROC curve worth reading. Loaded just in that chapter.
You do not need all of these for any single figure. Each chapter loads what it uses in its first chunk.