Skip to content
Prev 177169 / 398503 Next

Intersection of two sets of intervals

Stavros, you are quite correct -- I discovered that the hard way a 
little while ago when testing my two-line solution. Use of pmin/pmax 
don't handle, for instance, cases where more than one interval in one 
set is wholly contained by an interval in the other. (I have a 
mis-posted msg awaiting moderator approval in R-help with a concrete 
example.)

Your tip to check out the intervals pkg looks promising. FYI, there the 
general intersection is computed as the complement of the union of the 
complements, i.e. A*B = (A'+B')' , aka DeMorgan.

Thanks for the help,

-tom
On 4/15/2009 11:27 AM, Stavros Macrakis wrote: