title: For an hourly data, Getting maximum value for each day
body: <p>Let I have the following data :</p>
  
  <pre><code>time &lt;- seq(ISOdate(2007,7,1,0), ISOdate(2008,4,5,23), by = "1 hour")
  y &lt;- rnorm(n = length(time))
  
  year  &lt;- as.numeric(substr((as.character(time)), 1, 4))  # year number as numeric
  
  month &lt;- as.numeric(substr((as.character(time)), 6, 7))  # month number as numeric
  
  day &lt;- as.numeric(substr((as.character(time)), 9, 10))  # day number as numeric
  
  hour &lt;- as.numeric(substr((as.character(time)), 12, 13))  # hour number as numeric
  
  dat &lt;- data.frame(year=year, month=month, day=day, hour=hour, y = y)
  </code></pre>
  
  <p>For each day, there are 24 <code>y</code> values at each hour(0 to 23). Now I have to find maximum of <code>y</code> for each day. That is, say, for the date "2007-10-05" there are 24 <code>y</code> values obtained in each hour (0 to 23) and I have to get the maximum value for the day "2007-10-05". Hence since there are 279 days between "2007-07-01" to "2008-04-05", I will get 279 maximum <code>y</code> values.</p>
  
  <p>How can I do that?</p>