The data set is this
badData <- list(c(296,310), c(330,335), c(350,565))
df <- 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
The orginal question was whether to identify if wavelength
fell in any of the ranges given in badData
The solution offered is this
https://stackoverflow.com/a/52070363/1012249
my question is using a similar syntax, how does one identify which badData
bin it falls into. Lets say badData were structured like this, and bins are non-overlapping.
badData <- data.frame(bin=c('a','b','c'),start= c(296,330,350),end=c(310.01,335,565))