title: Time difference in R by group based on condition and two time columns
body: <p>I would like to get the time elapsed between events in my dataframe, for each grouping of data by the ID. The dates i want to use are in their own columns. I have done the following already using dplyr:</p>
  
  <ul>
  <li>Grouped my data by the ID</li>
  <li>Ordered by the ID</li>
  </ul>
  
  <p>This is how the data looks. I would like the output to be the time_diff column. Any help would be very much appreciated!</p>
  
  <pre><code>ID: Status:    Start-time:   End-time:    time-diff:
  1   Active      01/01/2018       NA           0
  1   Complete      NA         01/02/2018       1
  2   Active      03/02/2018                    0
  2   Active        NA                          0
  2   Complete      NA         03/06/2018       4
  </code></pre>