title: Aggregate15 minute data to hourly
body: <p>I have a data frame that looks like this:</p>
  <pre><code>     Timedate              TotalSolar_MW
  20  2013-06-01 04:45:00     13.0
  21  2013-06-01 05:00:00     41.7
  22  2013-06-01 05:15:00     81.8
  23  2013-06-01 05:30:00    153.0
  24  2013-06-01 05:45:00    270.7
  25  2013-06-01 06:00:00    429.3
  26  2013-06-01 06:15:00    535.4
  </code></pre>
  <p>&quot;Timedate&quot; is <code>POSIXlt</code>, and &quot;Total_Solar&quot; is <code>numeric</code>. The time steps are in 15 minute intervals from June 1, 0:00 to June 24, 24:00.</p>
  <p>Now I want to <code>aggregate</code> the quarter hourly data to hourly steps e.g. 2013-06-01 06:00:00 934.8MW (81.8MW + 153.0MW + 270.7MW + 429.3MW; from 05:15 to 06:00)</p>
  <p>I tried this with:</p>
  <pre><code> Sum &lt;-aggregate(Total_Solar_Gesamt$TotalSolar_MW, 
            list(as.POSIXlt(Total_Solar_Gesamt$Timedate)$hour), FUN=sum)
  </code></pre>
  <p>But it returns the aggregated hourly data of the whole data frame and gives me a new data.frame with 24 rows and the summed up MW for every hour.</p>
  <p>How can I change the structure, only to reduce from a quarter hourly to an hourly interval? I tried a for loop but this also didn't work. Also <code>subset</code> didn't work for me.</p>