title: How to create a table from the aggregate() function in R
body: <p>I have a data set that looks like this:</p>
  
  <pre><code>Type    Date    Lively  Count
  sm      1/13/2010   10  10
  sm      1/14/2010   10  20
  sm      2/15/2010   20  30
  am      4/16/2010   5   42
  am      1/17/2010   10  34
  am      3/18/2010   40  54
  sm      1/19/2010   10  65
  sm      4/20/2010   5   67
  sm      3/21/2010   40  76
  </code></pre>
  
  <p>I'm trying to average out all the numeric parameters by month. So my resultant data set would ideally be:</p>
  
  <pre><code>Date     Lively Count
  Jan 2010     10     32.25
  Feb 2010     20     30.00
  Mar 2010     40     65.00
  Apr 2010      5     54.50
  </code></pre>
  
  <p>I'm very close to this, what I currently have is:</p>
  
  <pre><code>         Lively Count
  Jan 2010     10     32.25
  Feb 2010     20     30.00
  Mar 2010     40     65.00
  Apr 2010      5     54.50
  </code></pre>
  
  <p>As you can see I'm missing the title 'Date'. Here is my code:</p>
  
  <pre><code>library(zoo)
  z &lt;- zoo(data[3:4], as.Date(data[,2], "%m/%d/%Y"))
  aggregate(z, as.yearmon, mean)
  </code></pre>
  
  <p>I don't know how to make a title for the left column ('Date'), and more importantly, I don't know how to make the output of aggregate() into a table (resultant data set).</p>