title: Adding another grouping with dplyr
body: <p>I would like to mutate a data frame twice, grouping by two sets of columns which intersect each other. i.e.:</p>
  
  <pre><code>df &lt;- df %&gt;% group_by(a, b) %&gt;% mutate(x = sum(d))
  df &lt;- df %&gt;% group_by(a, b, c) %&gt;% mutate(y = sum(e))
  </code></pre>
  
  <p>Is there a faster/more elegant way to do this? I was hoping to be able to do something like:</p>
  
  <pre><code>df &lt;- df %&gt;%
      group_by(a, b) %&gt;%
      mutate(x = sum(d)) %&gt;%
      group_by(c) %&gt;%
      mutate(y = sum(e))
  </code></pre>
  
  <p>Or perhaps save a variable with the first <code>group_by</code> applied and then use it twice.</p>