title: Efficient method of obtaining successive high values of data.frame column
body: <p>Lets say I have the following data.frame in R</p>
  
  <pre><code>df &lt;- data.frame(order=(1:10),value=c(1,7,3,5,9,2,9,10,2,3))
  </code></pre>
  
  <p>Other than looping through data an testing whether value exceeds previous high value how can I get successive high values so that I can end up with a table like this</p>
  
  <pre><code>order   value
   1        1
   2        7
   5        9
   8       10
  </code></pre>
  
  <p>TIA</p>