I know we can find the index of row of 11500 in column a with
which(df$a == 11500)
how about if I want to find the closest and less than a row index for a particular column value.
fore example in column a :
a
1
2
5
10
what is row number of a value which is less than or equal to 8 and closest to it? answer: the value is 5 and row index that I am trying to find is 3.