jpcompartir / DisplayR

https://jpcompartir.github.io/DisplayR/
Other
0 stars 2 forks source link

fix gt table to be compatible with 0.9.0 #14

Closed jpcompartir closed 1 year ago

jpcompartir commented 1 year ago

Offending code sections:

table <- table %>%
    gt::data_color(columns = Positive,
                   colors = positive_colorer) %>%
    gt::data_color(columns = Negative,
                   colors = negative_colorer) %>%
    gt::summary_rows(columns = c(Volume),
                     fns = list(Total = "sum"),
                     decimals = 0,
                     missing_text = "") #summary_rows has changed to make it incompatible with previous way of doing things.
gt::tab_style(style = gt::cell_text(weight = "600"),
                  locations = gt::cells_grand_summary())
gt::tab_style(style = gt::cell_text(style = "italic"),
                  locations = gt::cells_stub_grand_summary()) %>%
jpcompartir commented 1 year ago

Solved following this vignette: https://gt.rstudio.com/reference/summary_rows.html

switching to grand_summary_rows when not using grouped summaries.