title: renaming the output column with the plyr package in R
body: <p>Hadley turned me on to the <a href="http://had.co.nz/plyr/" rel="noreferrer">plyr</a> package and I find myself using it all the time to do 'group by' sort of stuff. But I find myself having to always rename the resulting columns since they default to V1, V2, etc. </p>
  
  <p>Here's an example:</p>
  
  <pre><code>mydata&lt;-data.frame(matrix(rnorm(144, mean=2, sd=2),72,2),c(rep("A",24),rep("B",24),rep("C",24)))
  colnames(mydata) &lt;- c("x_value", "acres",  "state")
  groupAcres &lt;- ddply(mydata, c("state"), function(df)c(sum(df$acres)))
  colnames(groupAcres) &lt;- c("state","stateAcres")
  </code></pre>
  
  <p>Is there a way to make ddply name the resulting column for me so I can omit that last line?</p>