Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread William Dunlap
, TIBCO Software wdunlap tibco.com From: Ben quant [mailto:ccqu...@gmail.com] Sent: Monday, May 14, 2012 1:19 PM To: Steve Lianoglou Cc: William Dunlap; r-help@r-project.org Subject: Re: [R] range segment exclusion using range endpoints Thank you Steve! This does everything I need (at this point

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
graphical check do > >> > plot(x, s, setdiffRanges(x, s)) > >> Are those the numbers you want? > >> > >> I find it easier to use standard functions and data structures for this > >> than > >> to adapt the cumsum/order idiom to different situations

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Steve Lianoglou
Bill Dunlap >> Spotfire, TIBCO Software >> wdunlap tibco.com >> >> >> > -Original Message- >> > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >> On Behalf >> > Of Ben quant >> > Sent: Monday, May 14

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
functions and data structures for this > than > to adapt the cumsum/order idiom to different situations. > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread William Dunlap
nt > Sent: Monday, May 14, 2012 11:07 AM > To: jim holtman > Cc: r-help@r-project.org > Subject: Re: [R] range segment exclusion using range endpoints > > Turns out this solution doesn't work if the s range is outside the range of > the x range. I didn't include tha

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
Turns out this solution doesn't work if the s range is outside the range of the x range. I didn't include that in my examples, but it is something I have to deal with quite often. For example s1_rng below causes an issue: x_rng = c(-100,100) s1_rng = c(-250.5,30) s2_rng = c(0.77,10) s3_rng = c(25

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
Great solution! Thanks! Ben On Sat, May 12, 2012 at 12:50 PM, jim holtman wrote: > Here is an example of how you might do it. It uses a technique of > counting how many items are in a queue based on their arrival times; > it can be used to also find areas of overlap. > > Note that it would be

Re: [R] range segment exclusion using range endpoints

2012-05-14 Thread Ben quant
", c(unlist(RangesList, recursive=FALSE), > list(finite=TRUE))) >ylim <- c(0, length(RangesList)+1) >plot(type="n", xlim, ylim, xlab="", ylab="", axes=FALSE) >grid(ny=0) >axis(side=1) >axis(side=2, at=seq_along(RangesList)

Re: [R] range segment exclusion using range endpoints

2012-05-12 Thread William Dunlap
gesList), lab=labels, las=1, tck=0) box() incr <- 0.45 / max(vapply(RangesList, nrow, 0)) xr <- par("usr")[1:2] # for intervals that extend to -Inf or Inf. for(i in seq_along(RangesList)) { r <- RangesList[[i]] if (nrow(r)>0) { y

Re: [R] range segment exclusion using range endpoints

2012-05-12 Thread jim holtman
Here is an example of how you might do it. It uses a technique of counting how many items are in a queue based on their arrival times; it can be used to also find areas of overlap. Note that it would be best to use a list for the 's' end points > # note the next

[R] range segment exclusion using range endpoints

2012-05-12 Thread Ben quant
Hello, I'm posting this again (with some small edits). I didn't get any replies last time...hoping for some this time. :) Currently I'm only coming up with brute force solutions to this issue (loops). I'm wondering if anyone has a better way to do this. Thank you for your help in advance! The pr