a>df <span class="sc">%&gt;%</span> </span>
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a>  <span class="fu">group_by</span>(g1, g2) <span class="sc">%&gt;%</span> </span>
<span id="cb1-3"><a href="#cb1-3" tabindex="-1"></a>  <span class="fu">summarise</span>(<span class="at">a =</span> <span class="fu">mean</span>(a), <span class="at">b =</span> <span class="fu">mean</span>(b), <span class="at">c =</span> <span class="fu">mean</span>(c), <span class="at">d =</span> <span class="fu">mean</span>(d))</s