Skip to content

[FEAT] Support for per-operation grouping within fsummarise/fmutate akin to dplyr's .by argument #881

Description

@wgrundlingh

What aspect of the package is your request related to?
dplyr introduced per-operation grouping support via a .by argument within functions like summarise and mutate in 2023 (dplyr 1.1.0), thereby avoiding explicit group_by() and ungroup() calls in a pipeline. A similar option for fsummarise and fmutate would be great!

Describe the solution you'd like
Instead of

<some pipeline> %>%
  fgroup_by(<group vars>) %>%
  fsummarise(<summary vars>) %>%
  fungroup() %>%
  <more pipeline>

allow for

<some pipeline> %>%
  fsummarise(
    .by = <group vars>,
    <summary vars>
  ) %>%
  <more pipeline>

and similarly for fmutate.

Additional context
This would allow for a virtual drop-in replacement of summarise or mutate functions into existing code, with much smaller pipeline modifications.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions