Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement tidy_group_by() #288

Open
larmarange opened this issue Feb 20, 2025 · 0 comments
Open

Implement tidy_group_by() #288

larmarange opened this issue Feb 20, 2025 · 0 comments
Assignees

Comments

@larmarange
Copy link
Owner

cf. ddsjoberg/gtsummary#1540

on broom.helpers side

New function tidy_group_by() and new option group_by in tidy_plus_plus().

This function will be in charge of preparing the results and, if needed, returning an additional group_by column in the results.

By default (group_by = "auto"), if there is a y.level column and this column has a minimum of 2 different values, then group_by will be populated with this column, or, if there is a component column and this column has a minimum of 2 different values, then group_by will be populated with component, otherwise no grouping will be performed. It will cover most standard use cases.

group_by = NULL to force no grouping.

group_by = "effect" (or another column name) indicating that we want to group according to a specific column returned by the tidier.

An option group_labels could be implemented to allow the user to rename the different groups.

Such an approach should be pretty flexible. It even allows the development of custom tidiers with other grouping options.

@larmarange larmarange self-assigned this Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant