Skip to content
Prev 313627 / 398513 Next

Hello R User

Hello R User,
In the sample data given below, time is recorded for each id
subsequently. For the analysis, for each id, I would like to set 1st
recorded time to zero and thereafter find the difference from previous
time. I.e. for ID==1, I would like to see Time=0,3,1,3,6. This needs
to be implemented to big data set.
Any suggestions are much appreciated!
Thanks,
Bibek

ID	Time
1	3
1	6
1	7
1	10
1	16
2	12
2	18
2	19
2	25
2	28
2	30