Tables

A figure rarely travels alone. The survival curve wants its numbers at risk, the manuscript wants its Table 1, and the trend plot reads better next to the counts behind it. This part covers those tables, and the plainer one that comes before any of them: the description of the dataset you are working from.

library(gt)

Four chapters follow, in the order you would actually meet them. Describing a dataset is the reconnaissance: proc_contents(), proc_means(), and data_dictionary() tell you which variables you are holding, what type each one came in as, and how much of each is populated. That chapter owns the dictionary; the data governance chapter puts the same artifact to work alongside labels and manifests. You cannot decide what belongs in a Table 1 until you know that. Publication tables then builds the Table 1 pattern by hand with gt, a row group at a time. Manuscript tables takes the same cohort the other way, through hvtiRtables into a Word file that follows the CORR table rules and the house median-and-percentiles convention, which is the route to take once the table is bound for a journal rather than the web. And tables that accompany figures pulls the companion numbers – numbers at risk, participation counts – straight off the same hv_*() object that drew the figure, so the table and its figure cannot disagree.