I have a dataset that is arranged like this:
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
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)
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).
I would like to call these out with dplyr mutate logic. Output:
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
I know that I should be using logic similar to this, but I I just can't figure it out.
Thanks in advance.
EDIT:
Bonus points if you can also tell me how to count the time/days elapsed between each stage even if it skips a couple.