title: Select N rows above and below match
body: <p>I would like to select N rows above and below a match.</p>
  
  <p>I'm trying the command:</p>
  
  <pre><code>mtcars[which(mtcars$vs == 1) + c(-1:1), ]
  </code></pre>
  
  <p>It returns the follow warning:  </p>
  
  <blockquote>
    <p>Warning message:
    In which(mtcars$vs == 1) + c(-1:1):
    longer object length is not a multiple of shorter object length</p>
  </blockquote>