title: Find a window of 2 rows either side of specific value and return information from a different column in R
body: <p>Hi I'm looking to find a window of 4 rows, 2 rows either side of pvalues less than a specific threshold, and then create a new data.table containing information regarding a specific character of these rows.</p>
  
  <pre><code>SNP pval  GO
  1   0.9   A
  2   0.8   C
  3   0.4   A
  4   0.3   D
  5   0.9   L
  6   0.02  L
  7   0.6   L
  8   0.1   G
  9   0.6   P
  10  0.8   E
  </code></pre>
  
  <p>From the example data above, looking at the 2 rows either side of a pval &lt; 0.05 the desired output would be.</p>
  
  <pre><code>GO
  D
  L
  L
  G
  </code></pre>
  
  <p>Ultimately I would like to extend this to a large data.frame and look at 1000 row windows for multiple pval &lt; 0.05</p>
  
  <p>Thankyou for any help</p>