gtsummary_butcher: Reduce size of gtsummary objects

Description Usage Arguments Value See Also Examples

View source: R/gtsummary_butcher.R

Description

Some gtsummary objects can become large and the size becomes cumbersome when working with the object. The function removes all elements from a gtsummary object, except those required to print the table. This may result in gtsummary functions that add information or modify the table, such as add_global_p(), will no longer execute after the excess elements have been removed (aka butchered). Of note, the majority of inline_text() calls will continue to execute properly.

Usage

1

Arguments

x

a gtsummary object

Value

a gtsummary object

See Also

Other gtsummary-related functions: add_inline_forest_plot(), as_ggplot(), gts_add_p_footnotes(), style_tbl_compact(), tbl_2way_summary(), tbl_split(), theme_gtsummary_msk()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(gtsummary)

tbl_large <-
 trial %>%
 tbl_uvregression(
   y = age,
   method = lm
 )

 tbl_butchered <-
   tbl_large %>%
   gtsummary_butcher()

 # size comparison
 object.size(tbl_large) %>% format(units = "Mb")
 object.size(tbl_butchered) %>% format(units = "Mb")

ddsjoberg/bstfun documentation built on Aug. 2, 2021, 2:16 p.m.