title: R: based on consecutive values in two rows, populate a third
body: <p>I have a feeling there's a <code>dplyr</code> solution to this, but I can't quite get there.</p>
  
  <p>I have a data frame:</p>
  
  <pre><code>Name     Job     ID1     ID2
  Name1    Job1    ID1a    ID2a
                   ID1a    ID2a
  Name2    Job2    ID1b    ID2b
  Name3    Job3    ID1c    ID2c
  </code></pre>
  
  <p>Whenever there's a repeat of the ID1 and ID2 column values, I want to insert a string called 'wait'. So the final data frame should look like this:</p>
  
  <pre><code>Name     Job     ID1     ID2
  Name1    Job1    ID1a    ID2a
           wait    ID1a    ID2a
  Name2    Job2    ID1b    ID2b
  Name3    Job3    ID1c    ID2c
  </code></pre>
  
  <p>There are tens of thousands of rows in my data frame. These repeat IDs occur fairly frequently. I want to insert the same 'wait' string every time ID1 and ID2 are repeated a second time. How can I do this in R?</p>