title: Aggregation requires fun.aggregate: length used as default
body: <p>I have a file that I would like to reshape it to use R: These are the commands that I am running. </p>
  
  <pre><code>x &lt;- data.frame(read.table("total.txt", sep=",", header=T)
  y &lt;- melt(x, id=c("Hostname", "Date", "MetricType"))
  </code></pre>
  
  <p>when I issue this command to basically combine date with hour, I get an error and the window hangs. </p>
  
  <pre><code>yy &lt;- cast(y, Hostname + Date + variable ~ MetricType)
  </code></pre>
  
  <p>This is the error:</p>
  
  <pre><code>Aggregation requires fun.aggregate: length used as default
         ServerNa Date       MetricType   Hour   Value
  19502  server1 01/05/2012  MemoryAVG    Hour5  41.830000
  19503  server1 01/05/2012 CPUMaximum    Hour5   9.000000
  19504  server1 01/05/2012 CPUAVG+Sev    Hour5   9.060000
  19505  server1 01/05/2012     CPUAVG    Hour5  30.460000
  19506  server1 01/05/2012         61    Hour5  63.400000
  19507  server1 01/05/2012         60    Hour5  59.300000
  19508  server2 01/05/2012  MemoryAVG    Hour5  10.690000
  19509  server2 01/05/2012 CPUMaximum    Hour5   1.000000
  19510  server2 01/05/2012 CPUAVG+Sev    Hour5   0.080000
  19511  server2 01/05/2012     CPUAVG    Hour5   1.350000
  </code></pre>
  
  <p>Is there an easy way to do this without hanging the server?</p>
  
  <p>when I used library(reshape2) and this:</p>
  
  <pre><code>yy &lt;- acast(y, Hostname + Date + variable ~ MetricType, fun.aggregate=mean)
  </code></pre>
  
  <p>all the values turn into NA. I have no clue what is going on?</p>