title: Use of lapply to identify which bin a particular value lies in
body: <p>The data set is this</p>
  
  <pre><code>badData &lt;- list(c(296,310), c(330,335), c(350,565))
  df &lt;- data.frame(wavelength = seq(300,360,5.008667),
                    reflectance = seq(-1,-61,-5.008667))
  df    
     wavelength reflectance
     300.0000   -1.000000
     305.0087   -6.008667
     310.0173  -11.017334
     315.0260  -16.026001
     320.0347  -21.034668
     325.0433  -26.043335
     330.0520  -31.052002
     335.0607  -36.060669
     340.0693  -41.069336
     345.0780  -46.078003
     350.0867  -51.086670
     355.0953  -56.095337
  </code></pre>
  
  <p>The orginal question was whether to identify if <code>wavelength</code> fell in any of the ranges given in <code>badData</code>
  The solution offered is this 
  <a href="https://stackoverflow.com/a/52070363/1012249">https://stackoverflow.com/a/52070363/1012249</a> </p>
  
  <p>my question is using a similar syntax, how does one identify which <code>badData</code> bin it falls into. Lets say badData were structured like this, and bins are non-overlapping.</p>
  
  <pre><code>badData &lt;- data.frame(bin=c('a','b','c'),start= c(296,330,350),end=c(310.01,335,565))
  </code></pre>