isOverlap-Interval-numeric-method: isOverlap

Description Usage Arguments Value Examples

Description

Method for checking if an interval is overlapping with a single number (start = end) or an ordered pair of numbers (start < end). Two intervals (start1, end1) and (start2, end2) are overlapping if (end2 >= start1 and start2 <= end1).

Usage

1
2
## S4 method for signature 'Interval,numeric'
isOverlap(theObject, someNumbers)

Arguments

theObject

an Interval object

someNumbers

a vector of one or two numbers to test overlap. If two numbers are provided, they are treated as an interval (start, end)

Value

a logical value TRUE or FALSE

Examples

1
2
3
4
5
6
7
8
i1 <- new("Interval", start=1.1, end=1.2, key="dummy")
isOverlap(i1, c(1.0, 1.5))
isOverlap(i1, 1.0)
## Not run: 
isOverlap(i1, c(2.0, 1.5))  # generate an error
isOverlap(i1, c(1.0, 1.5, 2))  # generate an error

## End(Not run)

rIntervalTree documentation built on May 2, 2019, 3:04 a.m.