I want to group the output of this dataframe into the maximum of values starting from each 0.
For example, the first group would be [0,221,551,...,2356]
Each grouping is to be added, if that helps!
print(without_Errors2$timeRelativeToTrialStart)
[1] 0   221   551   771   991  1154  1392  1596  1830  2041  2365     0   309   539   747   992  1198  1471  1681  1911  2129  2391     0   243   527   742   958  1207
[29]  1473  1671  1934  2188  2469     0   239  
 
    