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

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 <- sort(all[-

[R] find overlap between intervals

2007-10-31 Thread João Fadista
Dear all, I would like to be able to know the intervals of my data that overlap between them. Here it goes a small example: Input: Start End 440 443 380 443 290 468 Desired output: Start End 290 380 380 440 440 468 Best regards, João Fadista [[alternative HTML version

[R] find overlap between intervals - Correction

2007-10-31 Thread João Fadista
Dear all, Sorry for the previous email. I had a wrong example output: Input: Start End 440 443 380 443 290 468 CORRECTED Desired output: Start End 290 380 380 440 443 468 Best regards, João Fadista [[alternative HTML version deleted]] ___