Skip to content
Prev 378224 / 398503 Next

I can't get seq to behave how I think it should

Hi,

This looks like a floating point reality bump - see 

https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f <https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f>

You can use other methods to finding your row - I would opt for findInterval()
[1] 401

findInterval() uses a rapid search to find the index in the look up table (lut) that is just less than  or equal to the search value (in your example 1.8).

Cheers,
Ben