NO. Month  Year  Km   Diff
1    1     2010  200   200
1    1     2010  200   200
1    1     2010  200   200
1    2     2010  400   200
1    2     2010  400   200 
1    2     2010  400   200
1    3     2010  800   400
1    4     2010  1500  700
So, I want to take difference subject to Month and Year conditions having same serial No. column using dplyr R package. So, How to give multiple conditions subject to Serial No. and make cumulative difference?
 
    