title: Group data frame row by consecutive value in R
body: <p>I need to group a data frame by consecutive value in a row.
  So for example, given this data frame:</p>
  <pre><code>tibble( time = c(1,2,3,4,5,10,11,20,30,31,32,40) )
  </code></pre>
  <p>I want to have a grouping column like:</p>
  <pre><code>tibble( time = c(1,2,3,4,5,10,11,20,30,31,32,40), group=c(1,1,1,1,1,2,2,3,4,4,4,5) )
  </code></pre>
  <p>What's a tidyverse (or base R) way to get the column group as explained?</p>