title: Delete successive rows under condition in R
body: <p>I have a data frame</p>
  
  <pre><code>dt &lt;- read.table(text = "
  350 16
  352 0
  354 0
  359 0
  366 11
  376 38  
  380 28 
  386 0
  389 0
  397 55 
  398 45 
  399 0  
  400 19  
  402 30")
  </code></pre>
  
  <p>When successive rows contain zero in the second column, I want to keep only the zero row which precedes the non zero row in the second column.</p>
  
  <p>The result must be:</p>
  
  <pre><code>dt &lt;- read.table(text = "
  350 16
  359 0
  366 11
  376 38  
  380 28 
  389 0
  397 55 
  398 45 
  399 0  
  400 19  
  402 30")
  </code></pre>