I'm currently working on a rowwise() tutorial (https://github.com/laderast/tidyowl) and I realized that one thing I don't understand is the behavior of mutate() versus summarize() in a rowwise workflow.
They seem to do something similar, except that summarize() lets you select the outputted columns. For example:
Using summarise() along with rowwise() doesn't make much sense since summarise() performs aggregation and you can't aggregate single-row groups any further.
Supplying variables to summarise() without an aggregation method is essentially asking for it to be returned unchanged (i.e. summarise(species, island) is equivalent to summarise(species = species, island = island).
By the way, arithmetic operators like + will natively perform row-wise calculations so you don't need rowwise().
It's in the rowwise vignette, but it's an unusual approach, and, at least for me, a confusing one. Normally, one uses summarise to collapse a data frame down to a smaller number of rows while generating summary values (counts, averages, etc.) and mutate to add columns to a data frame without changing the rest of the data frame.
In the code below, the first example is from your question and parallels the rowwise vignette. The second example is what I think would be considered the "typical" way of achieving the same goal.
Yes, thanks for your feedback. Given both of these responses, I think it's probably easier to not talk about summarize() and just talk about mutate() in a rowwise context, with select() as an option.