jthomasmock / gtExtras

A Collection of Helper Functions for the gt Package.
https://jthomasmock.github.io/gtExtras/
Other
195 stars 27 forks source link

Manually omitting columns from output of gt_plt_summary()? #112

Closed emilyrosenthal closed 9 months ago

emilyrosenthal commented 11 months ago

Question

Is it possible to omit column(s) from the final gt_plt_summary() object (e.g., to omit the 'value' or 'missing' columns)? If so, how would one do so? Thank you!

jthomasmock commented 9 months ago

Howdy @emilyrosenthal - not at this time. It's kind of an "all or nothing" approach for summary statistics.

However, you can do this manually with gt::cols_hide():

# example reprex
library(gtExtras)

# hide the value column
> mtcars |> gt_plt_summary() |> gt::cols_hide(value)

# hide missing column
> mtcars |> gt_plt_summary() |> gt::cols_hide(n_missing)