title: Dynamics "rollapply" in R
body: <p>I am thinking of getting max of (N-1) rows by group in R (but not including the current row). Not sure how should I start with since each group has dynamics number of rows. For example:</p>
  
  <p><a href="https://i.stack.imgur.com/BLqWK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BLqWK.png" alt="Example of what I want"></a></p>
  
  <p>Thanks =)</p>