title: Find missing date range in R
body: <p>I have a dataframe of start and end dates, where each row represents a specific trip.</p>
  <p>Those date ranges makeup a continuous timeline except around April where there is a <strong>discontinuity</strong>/lack of data (because no trips were taken).</p>
  <p>I would like to find the start and end date of that specific period? <em>(using a tidy approach preferably)</em></p>
  <pre class="lang-r prettyprint-override"><code>library(tidyverse)
  
  df&lt;- data.frame(start = as.Date(c(&quot;2022-01-03&quot;, &quot;2022-01-18&quot;, &quot;2022-01-31&quot;, &quot;2022-03-01&quot; ,&quot;2022-03-08&quot;, &quot;2022-03-09&quot;, &quot;2022-04-15&quot;,
                       &quot;2022-04-20&quot;, &quot;2022-04-20&quot;,&quot;2022-05-03&quot;, &quot;2022-05-17&quot;, &quot;2022-05-17&quot;, &quot;2022-05-31&quot;, &quot;2022-06-05&quot;, &quot;2022-06-22&quot; ,&quot;2022-06-28&quot;, &quot;2022-07-11&quot;)), 
             end =  as.Date(c(&quot;2022-01-18&quot;,&quot;2022-01-31&quot;, &quot;2022-03-01&quot; ,&quot;2022-03-08&quot; ,&quot;2022-03-09&quot;, &quot;2022-03-25&quot;, &quot;2022-04-20&quot; ,&quot;2022-04-20&quot;, &quot;2022-05-03&quot;,
                      &quot;2022-05-17&quot; ,&quot;2022-05-17&quot;, &quot;2022-05-31&quot;, &quot;2022-06-05&quot; ,&quot;2022-06-22&quot; ,&quot;2022-06-28&quot; ,&quot;2022-07-11&quot;, &quot;2022-07-17&quot;))) %&gt;% 
    mutate(trip_number = as.character(row_number()))
  
  df %&gt;% 
    ggplot()+
    geom_segment(aes(x = start, xend = end, y =0, yend= 0, col = trip_number))+
    theme(legend.position = &quot;none&quot;)
  </code></pre>
  <p><img src="https://i.imgur.com/i8RXFMC.png" alt="" /></p>
  <p><sup>Created on 2022-07-17 by the <a href="https://reprex.tidyverse.org" rel="nofollow noreferrer">reprex package</a> (v2.0.1)</sup></p>