Skip to content

Feature request: Suggestion to rename tbl_strata_nested_stack()/tbl_strata() to clarify long vs. wide stratification output #2478

Description

@martincadek

Currently tbl_strata() (with default .combine_with = "tbl_merge") produces strata side-by-side as columns, while tbl_strata_nested_stack() stacks strata as rows. The current names don't immediately convey this "wide vs. long" distinction to users unfamiliar with the internals.

Suggestion: Consider renaming (with a standard deprecation cycle, e.g. lifecycle::deprecate_soft()) to:

tbl_strata() → tbl_strata_wide()
tbl_strata_nested_stack() → tbl_strata_long()
This would mirror the well-known wide/long terminology from tidyr::pivot_wider()/pivot_longer(), which many R users already have as a mental model for row- vs. column-oriented reshaping.

Open question: Since tbl_strata() supports .combine_with for both merge and stack behaviour, would it make more sense to keep tbl_strata() as the general-purpose function and only introduce tbl_strata_long() as an alias/wrapper for the stacking case, rather than renaming the base function?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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