title: Create a factor based on POSIXlt time?
body: <p>I am currently dealing with data stored in data frame with time in one column. I have to split whole day to some periods. Up to now, I have been doing this based on full hours</p>
  
  <pre><code>workingdata &lt;- read.csv(filename)
  workingdata$dateI &lt;- as.POSIXlt(workingdata$dateI,format="%Y-%m-%d %H:%M:%S")
  workingdata$hourI &lt;- workingdata$dateI$hour
  workingdata$shift &lt;- cut(workingdata$hourI, breaks=c(0,6,13,23),
                           labels=c("morning","midday","evening"),
                           include.lowest=TRUE,right=TRUE)
  </code></pre>
  
  <p>This worked fine, and created factor with three levels - <code>morning</code> for hours from 0:00 to 6:59, <code>midday</code> from 7:00 to 13:59, and <code>evening</code> from 14:00 to 23:59.</p>
  
  <p>Now I would like to do similar thing, but with cuts based on minutes/seconds, e.g. <code>midday</code> starting at <code>11:34:12</code>. Is there a way to do it with cuts based purely on POSIXlt? What will be the best approach?</p>
  
  <p><strong>Edit:</strong> I have tried specifying the cut as a POSIXlt object, but it seems to be including the date always, so it is not what I want...</p>
  
  <pre><code>&gt; brk&lt;-as.POSIXlt("11:34:12",format="%H:%M:%S")
  &gt; brk
  [1] "2012-11-16 11:34:12"
  </code></pre>