title: Specific dataset subseting
body: <p>I have a dataset:</p>
  
  <pre><code>x   y
  j   5
  k   2
  b   9
  b   1
  k   1
  g   8
  h   2
  k   4
  </code></pre>
  
  <p>I want to extract rows with value k in column x and row above it, so desired output is:</p>
  
  <pre><code>x   y
  j   5
  k   2
  b   1
  k   1
  h   2
  k   4
  </code></pre>
  
  <p>How could I do that? I know how to extract rows with value k in column x:</p>
  
  <pre><code>df[df$x=="k",]
  </code></pre>
  
  <p>, but how to extract also a row above it?</p>