title: How to detect missing payment in timeseries?
body: <p>I have a dataframe with monthly automatic payments of company X and Y, see dataframe.</p>
  <p>The exact dates can differ a bit due to the weekends, thus not each payment will be on the exact same day of the month for example.</p>
  <p>What is more important is that approximately each 30-34 days a payment has to be fulfilled by each company. The first payment date of company X is 2020-03-01, and the first payment date of company Y is 2020-03-10.</p>
  <pre><code>dat1 &lt;- data.frame(
    booked_at = c(&quot;2020-03-01&quot;, &quot;2020-03-10&quot;, &quot;2020-04-02&quot;, &quot;2020-04-10&quot;, &quot;2020-05-02&quot;, &quot;2020-06-10&quot;, 
                  &quot;2020-07-02&quot;, &quot;2020-07-10&quot;, &quot;2020-08-02&quot;, &quot;2020-09-09&quot;, &quot;2020-10-02&quot;, &quot;2020-10-10&quot;),
    amount    = rep.int(c(100, 150), 6),
    company   = c(&quot;X&quot;, &quot;Y&quot;, &quot;X&quot;, &quot;Y&quot;, &quot;X&quot;, &quot;Y&quot;, &quot;X&quot;, &quot;Y&quot;, &quot;X&quot;, &quot;Y&quot;, &quot;X&quot;, &quot;Y&quot;)
  )
  
  dat1
  
  #     booked_at amount company
  # 1  2020-03-01    100       X
  # 2  2020-03-10    150       Y
  # 3  2020-04-02    100       X
  # 4  2020-04-10    150       Y
  # 5  2020-05-02    100       X
  # 6  2020-06-10    150       Y
  # 7  2020-07-02    100       X
  # 8  2020-07-10    150       Y
  # 9  2020-08-02    100       X
  # 10 2020-09-09    150       Y
  # 11 2020-10-02    100       X
  # 12 2020-10-10    150       Y
  </code></pre>
  <p>As you can see, some payments are missing (e.g. &quot;2020-06-02&quot; and &quot;2020-09-02&quot; for company X and
  &quot;2020-05-10&quot; and &quot;2020-08-10&quot; for company Y).</p>
  <p>What I would like to create is a function that counts the missing payment dates. Thus, a new dataframe should expose those dates where a payment is missing, if possible.</p>
  <p>The final output of the function should show a dataframe with the company name and missing payment dates</p>