title: How to find date and hour when searching min/max values using xts in R
body: <p>I've been trying to find forums to answer this question, 
  but I'm afraid I didn't find how to solve this .. </p>
  
  <p>I have data with this format:</p>
  
  <pre><code>2013-12-17 22:45:00 18.521
  2013-12-17 23:00:00 17.760
  2013-12-17 23:15:00 18.140
  2013-12-17 23:30:00 18.806
  2013-12-17 23:45:00 18.045
  2013-12-18 02:00:00 16.427
  2013-12-18 02:15:00 16.237
  2013-12-18 04:15:00 11.236
  2013-12-18 04:30:00 11.041
  2013-12-18 04:45:00 11.041
  2013-12-18 05:00:00 10.846
  2013-12-18 05:15:00 10.455
  2013-12-18 05:30:00 10.553
  2013-12-18 05:45:00 10.063
  2013-12-18 06:00:00 10.259
  2013-12-18 06:15:00 10.161
  2013-12-18 06:30:00 10.063
  2013-12-18 06:45:00  9.866
  2013-12-18 07:00:00  9.866
  2013-12-18 07:15:00  9.965
  2013-12-18 07:30:00 10.651
  2013-12-18 07:45:00 10.944
  2013-12-18 08:00:00 11.431
  </code></pre>
  
  <p>The periodicity is 15 minutes each day, for several months.
  And it is already stored in a var with class: xts, zoo</p>
  
  <p>When I use:</p>
  
  <pre><code>period.apply(
    xts.ts,
    endpoints(xts.ts, on = "days", 1),
    function(x) apply(x, 2, min)
  )
  </code></pre>
  
  <p>I obtained something like this:</p>
  
  <pre><code>[,1]
  2013-12-11 23:45:00 10.455
  2013-12-12 23:45:00  8.879
  2013-12-13 23:45:00 12.980
  2013-12-14 23:45:00 12.883
  2013-12-15 23:45:00 12.497
  2013-12-16 23:45:00 10.944
  2013-12-17 23:45:00 11.041
  2013-12-18 08:00:00  9.866
  </code></pre>
  
  <p>However, I would like to know the exact time for the min value (or values) &amp; for each day,
  It always appears 23:45:00 (except in the last case: 08:00:00), 
  which is not correct, as you can see in the original data:</p>
  
  <pre><code>2013-12-18 06:45:00  9.866
  2013-12-18 07:00:00  9.866
  </code></pre>
  
  <p>Moreover, I try to use:</p>
  
  <pre><code>separated_by_days &lt;- split(xts.ts, f = "days", drop=FALSE, k = 1)
  </code></pre>
  
  <p>And I get a list with the info separated by days, but if I use</p>
  
  <pre><code>period.apply(
    separated_by_days[[1]],
    INDEX=endpoints(days[[1]], on="days"),
    FUN=min
  )
  </code></pre>
  
  <p>The result is the same. :(</p>
  
  <p>I would appreciate if you give me some clue for solving this.. Thank you!</p>