title: Check if column value is in between (range) of two other column values
body: <p>I have a data frame that looks like this (Dataframe X):</p>
  
  <pre><code>id  number  found
  1   5225    NA
  2   2222    NA
  3   3121    NA
  </code></pre>
  
  <p>I have another data frame that looks like this (Dataframe Y):</p>
  
  <pre><code>id  number1  number2    
  1   4000     6000
  3   2500     3300
  3   7000     8000
  </code></pre>
  
  <p>What I want to do is this: For each value in the Dataframe X "number" column, search if it is equal to or between ANY of the "number1" and "number2" pair values of Dataframe Y. Additionally, for this "number1" and "number2" pair values, its respective "id" must match the "id" in Dataframe X. If this is all true, then I want to insert a "YES in the "found" column of the respective row in Dataframe X:</p>
  
  <pre><code>id  number  found
  1   5225    YES
  2   2222    NA
  3   3121    YES
  </code></pre>
  
  <p>How would I go about doing this? Thanks for the help.</p>