d1<-data.frame(ID=c(1:6),
Locx1=c(100,121,146,194,162,182),
Locx2=c(148,170,184,236,196,190),
Locy1=c(119,173,104,164,188,142),
Locy2=c(168,180,120,210,190,213))
In the above data, Locx1 is the starting point of x and Locx2 is the endpoint of x, Locy1 is the starting point of y and Locy2 is the endpoint of y. I want to find the y values in which the 50% (and more) of the Locy1 and Locy2 is between the Locx1 and Locx2 in R. How can I do that?
For instance, the 1st row fits this example. the starting point of y is (119) between Locx1 and Locx2 and (148-119)/(168-119) is greater than %50.
Thanks