title: How to remove subsequent values after first instance only when other values are absent
body: <p>I am trying to remove zeros after the first instance of a zero, when all future values are 0. Eventually I would love to do this group_by species but baby steps. Here's an example;</p>
  
  <pre><code># Sample
  library(tidyverse)
  id&lt;-c("a","b","c","d","e","f","g","h","i","j")
  time&lt;-c(1,2,3,4,5,6,7,8,9,10)
  value&lt;-c(90, 50, 40, 0, 30, 30, 0, 10, 0, 0)
  df&lt;-data.frame(id, time, value)
  df
  
     id time value
  1   a    1    90
  2   b    2    50
  3   c    3    40
  4   d    4     0
  5   e    5    30
  6   f    6    30
  7   g    7     0
  8   h    8    10
  9   i    9     0
  10  j   10     0
  </code></pre>
  
  <p>I would like to see observation id "j" and only observation id "j" removed. I am not even sure where to start. Any suggestions are much appreciated!</p>