Skip to content

Overall column not added if adding labels before extras() #16

@kyleGrealis

Description

@kyleGrealis

Ordering seems to matter when using extras() and add_auto_labels(). See example:

This works

my_data |>
  tbl_summary(
    by = by_column,
    include = c(my_vars),
    type = list(all_continuous() ~ 'continuous2'),
    statistic = list(all_continuous2() ~ c('{mean}', '{min}, {p25}, {median}, {p75}, {max}')),
    missing = 'no'
  ) |>
  extras(overall = TRUE) |>
  add_auto_labels()

This FAILS

my_data |>
  tbl_summary(
    by = by_column,
    include = c(my_vars),
    type = list(all_continuous() ~ 'continuous2'),
    statistic = list(all_continuous2() ~ c('{mean}', '{min}, {p25}, {median}, {p75}, {max}')),
    missing = 'no'
  ) |>
  add_auto_labels() |>
  extras(overall = TRUE)  

TODO: Explore orderings

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions