new_shell.RdThe programmatic counterpart of read_shell(): builds and validates a
shell2tlf_shell from an in-memory list, so shells can be assembled in code
or in tests without a file on disk.
new_shell(x, source_file = NA_character_)A list with the same structure as the YAML in read_shell().
Optional path recorded for traceability, shown in the
header comment of shell_code().
An object of class shell2tlf_shell.
shell <- new_shell(list(
meta = list(id = "t_demo"),
title = "Table 1",
population = list(dataset = "adsl"),
columns = list(var = "TRT01A", total = "Total"),
rows = list(list(var = "AGE", label = "Age (years)", type = "summary",
stats = c("n", "mean_sd")))
))
shell
#>
#> ── shell2tlf display shell ─────────────────────────────────────────────────────
#> ℹ Table 1
#> ℹ Dataset: adsl | population: all records
#> ℹ Columns: TRT01A + Total
#>
#> ── Rows ──
#>
#> ✔ [summary] AGE - Age (years) (n, mean_sd)
#> ℹ Footnotes: 0 | rows per page: 24 (portrait)