title: Compare location of x y values between two dataframes
body: <p>I have two data frames (A &amp; B), each with columns of  x and y coordinates. For a given row in A, I want to know if there is a row (or multiple rows) <strong>anywhere</strong> in B that have values of B(X) and B(Y) that are each within a range of +/- 0.2 of the values in A(X) and A(Y). I also need to know the position of this row in B.</p>
  
  <p>Example data:</p>
  
  <pre><code>AX&lt;-c(1:5)
  AY&lt;-c(1.2,2.2,3.5,4.3,5.5)
  A&lt;-data.frame(AX, AY)
  BX&lt;- c(0.8,0.9,3.8,6,2.1)
  BY&lt;- c(1.1,1.4,4,7,2.4)
  B&lt;-data.frame(BX,BY)
  </code></pre>
  
  <p>The solution is like this:</p>
  
  <p>For row 1 of A- rows 1 and 2 of B are within the range</p>
  
  <p>For row 2 of A- row 5 of B is within the range</p>
  
  <p>For row 3 of A- no row of B is within the range,</p>
  
  <p>and so on.</p>
  
  <p>Essentially I am trying to find xy points in B that are near xy points in A. </p>