Re: [R] find overlap between intervals - Correction

2007-10-31 Thread Juan Manuel Barreneche
I'm not sure if i got the idea of what you want. At fist i thought that you wanted this output: Output: 290 380 380 440 440 443 443 468 to get it, you can use the following function: intervals - function(Input) { all - c(Input$Start, Input$End) numbers -

Re: [R] find overlap between intervals

2007-10-31 Thread jim holtman
Got a little bit of a different answer: x - Start End + 440 443 + 380 443 + 290 468 x.in - read.table(textConnection(x), header=TRUE) # create matrix to determine queue size (overlap) x.q - rbind(cbind(x.in$Start, 1), cbind(x.in$End, -1)) # sort x.q - x.q[order(x.q[,1], x.q[,2]),]