Hmm. What's the rationale for using group_by/summarize/ungroup with collabs? I'm trying to switch to `.by` and especially trying to teach with `.by`: shorter, safer [leftover groupings can cause problems]); cases where you want to `group_by()` to do several operations in a row are rarer ...
2. The way it's written within a piped sequence is opposite to the order it was: reading top to bottom left to right we compare group=>summarize to summarize=>group.
I'd rather write out
summarize(.by = group, a = mean(x))
But that's not the order in the function, and also...
Both! I break my summaries in those groups. There’s usually a group_by chunk (ie, summaries of the same group) and a .by chunk (where I want a single pipe with multiple grouped outputs).
Usually A.
I like the .by approach in theory. What keeps me using group_by() is that that's resilient to any prior grouping in my workflow, whereas .by breaks if the dataframe is already grouped.
If I want to use .by, I would need to totally commit to making that my workflow. No group_by(), or at least none without immediately ungroup()ing. And that's a relatively heavy cognitive lift.