So the situation is this: I basically have one data frame that contains about 100,000 rows of data. I am interested in a specific data column, POS, and I would like to check if the POS value is between the two values of another data frame, Start and End, and keep track of how many instances of these objects exist.
For example, in my first data frame, I have something like
ID POS
A 20
B 533
C 600
And in my other data frame, I have things like
START END
123 150
489 552
590 600
I want to know how many items in POS are in any of the START-END ranges. So in this case there are 2 elements. Also, if possible, can I get the identifiers of those who have POS between Start and End?
How can I do this without using a nested loop?
source