Skip to contents

Apply the stripped-down table look in one verb. The column-label divider (midrule) becomes the only rule drawn, and every bold-by-default surface renders in normal weight: the title block, the column-header band, the subgroup banner, and the section-header rows synthesized for usage = "group" columns. The analogue of ggplot2's theme_minimal(), composable on the pipe between the build verbs and the terminal emit() / as_grid().

Usage

preset_minimal(.spec, ...)

Arguments

.spec

The tabular_spec to apply the minimal theme to. <tabular_spec>: required. Dot-prefixed so partial matching cannot bind a ... knob to the spec slot.

...

Named preset knobs. Forwarded verbatim to preset() (e.g. font_size, font_family, orientation, paper_size, margins), so a single call sets both the minimal look and the page geometry.

Restriction: the rules (and legacy borders) knob is owned by this helper and may not be passed here; call preset() directly for a custom rule set.

Value

The updated tabular_spec. Continue chaining with paginate() / style(), then render via emit() (or resolve without I/O via as_grid()).

Details

What it sets, both at theme (lowest) precedence so an explicit later style() wins:

  1. Rules. Drops the booktabs toprule and bottomrule (the outer frame), keeping the midrule under the column labels and the muted column-spanner spanrule. Equivalent to preset(rules = list(toprule = "none", bottomrule = "none")).

  2. Weight. Sets bold = FALSE on the title, column-header, subgroup-label, and group-header surfaces. The HTML backend overrides its font-weight: 600 class default with an inline font-weight: normal; the paginated backends (RTF / LaTeX / PDF / DOCX) suppress the surface's bold run.

Last verb wins. Because the weight layers ride the theme tier, a later explicit style(bold = TRUE, .at = cells_title()) (or any surface) re-bolds it. Treat preset_minimal() as the theme baseline and override individual surfaces afterwards.

Markdown. GFM cannot represent colour / background / font on a surface; rendering a styled surface to .md emits a one-time tabular_warning_fidelity and degrades gracefully. Weight (bold) and italic carry through.

See also

Underlying verbs: preset() (the rule presets "booktabs" / "grid" / "frame" / "none" live there as rules string sugar), style().

Target the surfaces it touches: cells_title(), cells_headers(), cells_subgroup_labels(), cells_group_headers().

Entry / terminal verbs: tabular(), emit(), as_grid().

Examples

# ---- Example 1: Minimal AE overall summary ----
#
# The overall adverse-event summary with a single rule under the
# column labels and no bold anywhere. `preset_minimal()` is the theme
# baseline; the page stays at the session default geometry.
demo_n <- stats::setNames(cdisc_saf_n$n, cdisc_saf_n$arm_short)

tabular(
  cdisc_saf_ae,
  titles = c(
    "Table 14.3.1",
    "Overall Summary of Adverse Events",
    "Safety Population"
  ),
  footnotes = "Subjects counted once per category."
) |>
  cols(
    stat_label = col_spec(label = "Category"),
    placebo    = col_spec(label = "Placebo\nN={demo_n['placebo']}"),
    drug_50    = col_spec(label = "Drug 50\nN={demo_n['drug_50']}"),
    drug_100   = col_spec(label = "Drug 100\nN={demo_n['drug_100']}"),
    Total      = col_spec(label = "Total\nN={demo_n['Total']}")
  ) |>
  preset_minimal()

 

Table 14.3.1

Overall Summary of Adverse Events

Safety Population

 

CategoryPlacebo
N=86
Drug 50
N=96
Drug 100
N=72
Total
N=254
Any TEAE65 (75.6)84 (87.5)68 (94.4)217 (85.4)
Any Serious AE (SAE)0 (0.0)2 (2.1)1 (1.4)3 (1.2)
Any AE Related to Study Drug43 (50.0)77 (80.2)64 (88.9)184 (72.4)
Any AE Leading to Death2 (2.3)1 (1.0)0 (0.0)3 (1.2)
Any AE Recovered / Resolved47 (54.7)61 (63.5)49 (68.1)157 (61.8)
  Maximum severity: Mild36 (41.9)21 (21.9)20 (27.8)77 (30.3)
  Maximum severity: Moderate24 (27.9)47 (49.0)40 (55.6)111 (43.7)
  Maximum severity: Severe5 (5.8)16 (16.7)8 (11.1)29 (11.4)

 

Subjects counted once per category.

# ---- Example 2: Flat AE table under the minimal theme, then tint ---- # # AE by SOC / PT rendered flat: the SOC subtotal row and its PT rows # share the `label` stub, indented by `indent_level` (SOC at depth 0, # PT at depth 1), so each SOC name appears once. `preset_minimal()` # strips the outer frame and leaves the column-header band plain; a # trailing `style()` tints just that band, showing a per-table # override composing on top of the theme, and `font_size` forwards # through `...`. tabular( cdisc_saf_aesocpt, titles = c("Table 14.3.2", "Adverse Events by SOC and Preferred Term"), footnotes = "Subjects counted once per SOC and once per PT." ) |> cols( label = col_spec(label = "SOC / PT", indent = "indent_level"), soc = col_spec(visible = FALSE), row_type = col_spec(visible = FALSE), soc_n = col_spec(visible = FALSE), n_total = col_spec(visible = FALSE), placebo = col_spec(label = "Placebo\nN={demo_n['placebo']}"), drug_50 = col_spec(label = "Drug 50\nN={demo_n['drug_50']}"), drug_100 = col_spec(label = "Drug 100\nN={demo_n['drug_100']}"), Total = col_spec(label = "Total\nN={demo_n['Total']}") ) |> preset_minimal(font_size = 8) |> style(background = "#DBE4F0", .at = cells_headers())

 

Table 14.3.2

Adverse Events by SOC and Preferred Term

 

SOC / PTPlacebo
N=86
Drug 50
N=96
Drug 100
N=72
Total
N=254
TOTAL SUBJECTS WITH AN EVENT52 (60.5)81 (84.4)66 (91.7)199 (78.3)
SKIN AND SUBCUTANEOUS TISSUE DISORDERS19 (22.1)36 (37.5)35 (48.6)90 (35.4)
PRURITUS8 (9.3)21 (21.9)25 (34.7)54 (21.3)
ERYTHEMA8 (9.3)14 (14.6)14 (19.4)36 (14.2)
RASH5 (5.8)13 (13.5)8 (11.1)26 (10.2)
HYPERHIDROSIS2 (2.3)4 (4.2)8 (11.1)14 (5.5)
SKIN IRRITATION3 (3.5)6 (6.2)5 (6.9)14 (5.5)
GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS15 (17.4)36 (37.5)30 (41.7)81 (31.9)
APPLICATION SITE PRURITUS6 (7.0)23 (24.0)21 (29.2)50 (19.7)
APPLICATION SITE ERYTHEMA3 (3.5)13 (13.5)14 (19.4)30 (11.8)
APPLICATION SITE DERMATITIS5 (5.8)9 (9.4)7 (9.7)21 (8.3)
APPLICATION SITE IRRITATION3 (3.5)9 (9.4)9 (12.5)21 (8.3)
APPLICATION SITE VESICLES1 (1.2)5 (5.2)5 (6.9)11 (4.3)
GASTROINTESTINAL DISORDERS13 (15.1)12 (12.5)17 (23.6)42 (16.5)
DIARRHOEA9 (10.5)5 (5.2)3 (4.2)17 (6.7)
VOMITING3 (3.5)4 (4.2)6 (8.3)13 (5.1)
NAUSEA3 (3.5)3 (3.1)6 (8.3)12 (4.7)
ABDOMINAL PAIN1 (1.2)3 (3.1)1 (1.4)5 (2.0)
SALIVARY HYPERSECRETION0 (0.0)0 (0.0)4 (5.6)4 (1.6)
NERVOUS SYSTEM DISORDERS6 (7.0)18 (18.8)17 (23.6)41 (16.1)
DIZZINESS2 (2.3)9 (9.4)10 (13.9)21 (8.3)
HEADACHE3 (3.5)3 (3.1)5 (6.9)11 (4.3)
SYNCOPE0 (0.0)5 (5.2)2 (2.8)7 (2.8)
SOMNOLENCE2 (2.3)3 (3.1)1 (1.4)6 (2.4)
TRANSIENT ISCHAEMIC ATTACK0 (0.0)2 (2.1)1 (1.4)3 (1.2)
CARDIAC DISORDERS7 (8.1)12 (12.5)14 (19.4)33 (13.0)
SINUS BRADYCARDIA2 (2.3)7 (7.3)8 (11.1)17 (6.7)
MYOCARDIAL INFARCTION4 (4.7)2 (2.1)4 (5.6)10 (3.9)
ATRIAL FIBRILLATION1 (1.2)2 (2.1)2 (2.8)5 (2.0)
SUPRAVENTRICULAR EXTRASYSTOLES1 (1.2)1 (1.0)1 (1.4)3 (1.2)
VENTRICULAR EXTRASYSTOLES0 (0.0)2 (2.1)1 (1.4)3 (1.2)
INFECTIONS AND INFESTATIONS12 (14.0)6 (6.2)11 (15.3)29 (11.4)
NASOPHARYNGITIS2 (2.3)4 (4.2)6 (8.3)12 (4.7)
UPPER RESPIRATORY TRACT INFECTION6 (7.0)1 (1.0)3 (4.2)10 (3.9)
INFLUENZA1 (1.2)1 (1.0)1 (1.4)3 (1.2)
URINARY TRACT INFECTION2 (2.3)0 (0.0)1 (1.4)3 (1.2)
CYSTITIS1 (1.2)0 (0.0)1 (1.4)2 (0.8)
RESPIRATORY, THORACIC AND MEDIASTINAL DISORDERS5 (5.8)8 (8.3)9 (12.5)22 (8.7)
COUGH1 (1.2)5 (5.2)5 (6.9)11 (4.3)
NASAL CONGESTION3 (3.5)1 (1.0)3 (4.2)7 (2.8)
DYSPNOEA1 (1.2)1 (1.0)1 (1.4)3 (1.2)
EPISTAXIS0 (0.0)1 (1.0)2 (2.8)3 (1.2)
PHARYNGOLARYNGEAL PAIN0 (0.0)1 (1.0)1 (1.4)2 (0.8)
PSYCHIATRIC DISORDERS7 (8.1)9 (9.4)3 (4.2)19 (7.5)
CONFUSIONAL STATE2 (2.3)3 (3.1)1 (1.4)6 (2.4)
AGITATION2 (2.3)3 (3.1)0 (0.0)5 (2.0)
INSOMNIA2 (2.3)0 (0.0)2 (2.8)4 (1.6)
ANXIETY0 (0.0)3 (3.1)0 (0.0)3 (1.2)
DELUSION1 (1.2)0 (0.0)1 (1.4)2 (0.8)
MUSCULOSKELETAL AND CONNECTIVE TISSUE DISORDERS3 (3.5)6 (6.2)5 (6.9)14 (5.5)
BACK PAIN1 (1.2)1 (1.0)3 (4.2)5 (2.0)
ARTHRALGIA1 (1.2)2 (2.1)1 (1.4)4 (1.6)
SHOULDER PAIN1 (1.2)2 (2.1)0 (0.0)3 (1.2)
MUSCLE SPASMS0 (0.0)1 (1.0)1 (1.4)2 (0.8)
ARTHRITIS0 (0.0)0 (0.0)1 (1.4)1 (0.4)
INVESTIGATIONS5 (5.8)4 (4.2)3 (4.2)12 (4.7)
ELECTROCARDIOGRAM ST SEGMENT DEPRESSION4 (4.7)1 (1.0)0 (0.0)5 (2.0)
ELECTROCARDIOGRAM T WAVE INVERSION2 (2.3)1 (1.0)1 (1.4)4 (1.6)
BLOOD GLUCOSE INCREASED0 (0.0)1 (1.0)1 (1.4)2 (0.8)
ELECTROCARDIOGRAM T WAVE AMPLITUDE DECREASED1 (1.2)1 (1.0)0 (0.0)2 (0.8)
BIOPSY0 (0.0)0 (0.0)1 (1.4)1 (0.4)

 

Subjects counted once per SOC and once per PT.