title: Split hms column into 30 minute intervals
body: <p>I have participant data during an exercise test, which includes participant ID, the condition (either Environmental or Control) and the total time taken to complete the test. A small example of my data:</p>
  <pre><code>    RawData &lt;- data.frame(
        ParticipantID = c (1:6), 
        Condition = c(&quot;Control&quot;,&quot;Experimental&quot;,&quot;Experimental&quot;,&quot;Control&quot;,&quot;Experimental&quot;,&quot;Control&quot;),
        Time = c(&quot;04:34:22&quot;,&quot;02:48:47&quot;,&quot;04:22:06&quot;,&quot;02:57:11&quot;,&quot;02:07:11&quot;,&quot;05:34:22&quot;))
  </code></pre>
  <p>I then used the <code>lubridate</code> package so I have time in <code>hms</code> via:</p>
  <pre><code>RawData &lt;- RawData %&gt;% 
    mutate(TotalTime = hms::as_hms(Time)) 
  </code></pre>
  <p>Now I wish to create a new column, that bins each <code>RawData$TotalTime</code> result into a category including: Sub2, Sub230, Sub3, Sub330, Sub4, Sub430, Sub5, Sub530 and Sub6. I could probably do this via a long <code>case_when</code> statement but is there an easy way to do this in <code>lubridate</code> given I am after 30 minute intervals?</p>
  <p>My desired output would be:</p>
  <pre><code>   RawData &lt;- data.frame(
        ParticipantID = c (1:6), 
        Condition = c(&quot;Control&quot;,&quot;Experimental&quot;,&quot;Experimental&quot;,&quot;Control&quot;,&quot;Experimental&quot;,&quot;Control&quot;),
        Time = c(&quot;04:34:22&quot;,&quot;02:48:47&quot;,&quot;04:22:06&quot;,&quot;02:57:11&quot;,&quot;02:07:11&quot;,&quot;05:34:22&quot;),
        Category = c(&quot;Sub5&quot;,&quot;Sub3&quot;,&quot;Sub430&quot;,&quot;Sub3&quot;,&quot;Sub230&quot;,&quot;Sub6&quot;))
  </code></pre>
  <p>Thank you!</p>