title: How to group elements in a dataframe by a specific element number in R?
body: <p>I want to group the output of this dataframe into the maximum of values starting from each 0.</p>
  <p>For example, the first group would be [0,221,551,...,2356]</p>
  <p>Each grouping is to be added, if that helps!</p>
  <blockquote>
  <p>print(without_Errors2$timeRelativeToTrialStart)</p>
  </blockquote>
  <pre><code>[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  
  </code></pre>