title: Conditional and/or nested ifelse mutate logic with dplyr
body: <p>I have a dataset that is arranged like this:</p>
  
  <pre><code>ID   A   B  C   D   Win  Loss
  001  NA  3  NA  NA  6    NA  
  002  NA  NA NA  NA  NA   17
  003  1   5  12  18  NA   22
  004  NA  7  9   NA  31   NA
  005  8   2  NA  NA  NA   14
  006  2   6  12  19  25   NA
  007  NA  NA NA  NA  6    NA 
  </code></pre>
  
  <p>In this dataset, IDs are supposed to move through each stage (A, B, C, D) chronologically and hit either Win/Loss at the end (ID 003 and 006)</p>
  
  <p>Sometimes, however, IDs move backwards (ID 005), others skip stages (ID 001 and 004) and some go directly to Win/Loss (ID 002 and 007). </p>
  
  <p>I would like to call these out with dplyr mutate logic. Output:</p>
  
  <pre><code>ID   A   B  C   D   Win  Loss  Backwards Skip  Just W/L
  001  NA  3  NA  NA  6    NA    F         T     F
  002  NA  NA NA  NA  NA   17    F         T     T
  003  1   5  12  18  NA   22    F         F     F
  004  NA  7  9   NA  31   NA    F         T     F
  005  8   2  NA  NA  NA   14    T         T     F
  006  2   6  12  19  25   NA    F         F     F
  007  NA  NA NA  NA  6    NA    F         T     T
  </code></pre>
  
  <p>I know that I should be using logic similar to <a href="https://stackoverflow.com/questions/24459752/can-dplyr-package-be-used-for-conditional-mutating">this</a>, but I I just can't figure it out.</p>
  
  <p>Thanks in advance.</p>
  
  <p>EDIT:</p>
  
  <p>Bonus points if you can also tell me how to count the time/days elapsed between each stage even if it skips a couple.</p>