intersectInterval {rIntervalTree} | R Documentation |
intersectInterval
Description
Method for searching the interval tree. Given a single number or an ordered pair of numbers denoting the start and end of an interval, all intervals that overlapping the query interval in the interval tree will be retrieved.
Usage
intersectInterval(aTree, someNumbers)
Arguments
aTree |
a list object representing an interval tree |
someNumbers |
a vector of one or two numbers to test for overlap. If two numbers are provided, they are treated as an interval (start, end). |
Value
a list of vectors. Each vector contains (name, start, end) of an interval
Examples
i1 <- new("Interval", start=1.1,end=1.2, key="dummy1")
i2 <- new("Interval", start=-1.1,end=1.2, key="dummy2")
i3 <- new("Interval", start=-10.1,end=-1.2, key="dummy3")
i4 <- new("Interval", start=-1.1,end=1.2, key="dummy4")
i5 <- new("Interval", start=-10,end=2, key="dummy5")
i6 <- new("Interval", start=-8,end=-5, key="dummy6")
myList <- list(i1, i2, i3, i4, i5, i6)
atree <- treeFromInterval(myList)
## Not run:
intersectInterval(atree, c(-16, -26)) # generate an error
## End(Not run)
intersectInterval(atree, c(1, 5))
intersectInterval(atree, c(-12, 15))
intersectInterval(atree, 0)
[Package rIntervalTree version 0.1.0 Index]