title: match 2 column elements based on a differece within a range
body: <p>I want to match the elements of two unequal columns from two different data frames if they fall within the range: 1 to 3 (2+/-1)</p>
  
  <p>My data frames: </p>
  
  <p>dat1:</p>
  
  <pre><code>Number  status
  10023   T
  10324   F
  12277   F
  12888   T
  12000   T
  </code></pre>
  
  <p>dat2:</p>
  
  <pre><code>Number  status
  10020   T
  10002   F
  12279   F
  12888   T
  </code></pre>
  
  <p>Required ouput:</p>
  
  <pre><code>10023   10020   T
  12277   12279   F
  </code></pre>
  
  <p>My attempt (below) did not work:</p>
  
  <pre><code>diff &lt;- 2
  allow &lt;- 1
  
  NewData &lt;- dat1$Number %in% (dat2$Number&lt;=diff+allow | dat2$Number&gt;=diff+allow)
  </code></pre>
  
  <p>Help will be appreciated. </p>