title: how to count a "batch" every 15 minutes
body: <pre><code>1 2021-01-01 12:59:38
  2 2021-01-01 14:08:59
  3 2021-01-01 14:09:08
  4 2021-01-01 14:11:30
  5 2021-01-01 14:22:19
  6 2021-01-01 14:41:07
  </code></pre>
  <p>I want to be able to count the number of entries every 15 minutes but on a rolling basis. E.g 12:59 would be 1 within 15 mins, 14:08 =&gt; 14:22 would all be within 15 minutes so this would return 4 in this batch and finally 14:41 would be by itself in another 15 minute batch.</p>
  <p>I hope this makes sense and thanks in advance.</p>
  <p>Apologies for not including this</p>
  <pre><code>&gt; dput(df)
  structure(list(ClickedDate = structure(c(1609460198.707, 1609462979.593, 
  1609465088.437, 1609476270.88, 1609478479.177, 1609479667.373, 
  1609493081.887, 1609499187.29, 1609507506.37, 1609510989.533, 
  1609511522.023, 1609511894.067, 1609512194.773, 1609512377.227, 
  1609514474.153), tzone = &quot;UTC&quot;, class = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;
  )), batch_no = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 
  12L, 12L, 12L, 13L), batch_size = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
  1L, 1L, 1L, 1L, 3L, 3L, 3L, 1L)), row.names = c(NA, -15L), class = c(&quot;tbl_df&quot;, 
  &quot;tbl&quot;, &quot;data.frame&quot;))
  </code></pre>
  <p>NEW EDIT - Thank you for working on this. I am getting an error</p>
  <pre><code>Error in UseMethod(&quot;mutate&quot;) : 
    no applicable method for 'mutate' applied to an object of class &quot;c('integer', 'numeric')&quot;
  </code></pre>
  <p>This seems odd, my variable is in class</p>
  <pre><code>&gt; class(df$ClickedDate)
  [1] &quot;POSIXct&quot; &quot;POSIXt&quot; 
  </code></pre>
  <p>Does this work with mutate, or do I need to convert this?</p>
  <pre><code>&gt; dput(df)
  structure(list(ClickedDate = structure(c(1609460198.707, 1609462979.593, 
  1609465088.437, 1609476270.88, 1609478479.177, 1609479667.373, 
  1609493081.887, 1609499187.29, 1609507506.37, 1609510989.533, 
  1609511522.023, 1609511894.067, 1609512194.773, 1609512377.227, 
  1609514474.153), tzone = &quot;UTC&quot;, class = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;
  )), batch_no = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 
  12L, 12L, 12L, 13L), batch_size = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
  1L, 1L, 1L, 1L, 3L, 3L, 3L, 1L)), row.names = c(NA, -15L), class = c(&quot;tbl_df&quot;, 
  &quot;tbl&quot;, &quot;data.frame&quot;))
  </code></pre>
  <p>Thanks in advance</p>