title: Passing formula to aggregate
body: <p>I want to calculate groupby stats for multiple variables in a <code>data.frame</code>.</p>
  
  <p>I understand you can do this:</p>
  
  <pre><code>aggregate(cbind(Ozone, Temp) ~ Month, data=airquality, mean)
  </code></pre>
  
  <p>But how do I make it more general? That is, instead of specifying the variable names explicitly like <code>cbind(Ozone, Temp)</code>, I want to do (for example)</p>
  
  <pre><code>aggregate(names(airquality)[1:10] ~ Month, data=airquality, mean)
  </code></pre>
  
  <p>which does not work since <code>names(airquality)[1:10]</code> would be a vector of strings. </p>
  
  <p>How would I do this? I tried to generate a formula with <code>as.formula</code> and <code>paste</code> but no luck.</p>