title: aggregate through across multiple columns in R
body: <p>Suppose I have a <code>data.frame</code> called <code>df</code></p>
  
  <pre><code>x y z
  1 2 3
  2 3 4
  3 4 5
  1 3 4
  2 4 5
  </code></pre>
  
  <p>I want to </p>
  
  <ol>
  <li>group the data by <code>x</code></li>
  <li>for each sub <code>data.frame</code>, do <code>func(df$y, df$z)</code></li>
  </ol>
  
  <p>How to do this without a loop?</p>