> [1] 0.4 0.6 0.3 0.7</span>
<span class="r-in"><span><span class="fu">percs_by_group</span><span class="op">(</span><span class="va">x</span>, <span class="va">g1</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 40 60 30 70</span>
<span class="r-in"><span><span class="fu">props_by_group</span><span class="op">(</span><span class="va">x</span>, <span class="va">g2</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#