title: Subsetting value when condition is met
body: <p>I have a data frame which holds the times of random events occurring. What I want, is to subset the first case when either 'place' or 'Show' appears under Event, combined with 'kick' or 'Type' appearing under Event 2. So in this case, 'place run' wouldn't satisfy the condition, even though 'place' does appear under 'Event'. When I say the first case, I only want the first case when either of those options occur before the time resets back to 0. So for the first segment, the output I would want is 27, as this is the first time value when the condition is satisfied. For the second segment, I would want 16. For the last segment, the output would be 41. (I've put asterisk surrounding the rows which meet the condition so its easy to locate them. This isn't actually present in the data.)</p>
  
  <pre><code>Time Event  Event 2
   0   Begin   NA
   23  place   run
   27  *Show   Type*
   34  *place  kick*
   41  good    bye
   42  *place  kick*
   0   Begin   NA
   11  Hat     Yellow
   13  Show    Green
   16  *place  kick*
   20  place   hit
   29  sign    redeem
   35  *Show   Type*
   0   Begin   NA
   5   Cream   Glue
   17  Show    Green
   18  Orange  Screen
   30  place   hit
   33  sign    redeem
   41  *Show   Type*
    0  Begin   NA
   ...
  </code></pre>
  
  <p>EDIT : So far, what I'm able to do, is subset the rows that have Show Type or place kick with the following code :</p>
  
  <pre><code>Rows &lt;- Data[(Data[,'Event'] == 'Show' &amp; Data[,'Event 2']== 'Type') |
                    (Data[,'Event'] == 'place' &amp; Data[,'Event 2']== 'kick' ),]
  </code></pre>
  
  <p>Where I'm struggling, is being able to reset the search for these values after Time resets back to 0. Any help will be greatly appreciated!</p>