Skip to contents

A table object carries the data and statistics it was built from, so it can become large. tbl_butcher() removes every element except those required to print the table. Functions that add information or modify the table, such as add_global_p(), no longer run on the butchered object; most inline_text() calls continue to work.

Usage

tbl_butcher(x, include = c("table_body", "table_styling"))

Arguments

x

(ltsummary)
An ltsummary object.

include

(character)
Names of additional elements to retain in the object. c("table_body", "table_styling") is always retained.

Value

An ltsummary object.

Examples

tbl_large <- tbl_uvregression(trial, y = age, method = lm)
tbl_butchered <- tbl_butcher(tbl_large)

# size comparison
object.size(tbl_large) |> format(units = "Kb")
#> [1] "5901.2 Kb"
object.size(tbl_butchered) |> format(units = "Kb")
#> [1] "1657.6 Kb"