collectIntervals: collectIntervals

Description Usage Arguments Value Examples

View source: R/IntervalTree.R

Description

Method for enumerating all intervals in a interval tree (a list object).

Usage

1

Arguments

aTree

a recursive list storing Interval object

Value

a flattened list of Interval object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)
collectIntervals(atree)
collectIntervals(list())

Example output

[[1]]
An object of class "Interval"
Slot "start":
[1] -10.1

Slot "end":
[1] -1.2

Slot "key":
[1] "dummy3"


[[2]]
An object of class "Interval"
Slot "start":
[1] -10

Slot "end":
[1] 2

Slot "key":
[1] "dummy5"


[[3]]
An object of class "Interval"
Slot "start":
[1] -8

Slot "end":
[1] -5

Slot "key":
[1] "dummy6"


[[4]]
An object of class "Interval"
Slot "start":
[1] -1.1

Slot "end":
[1] 1.2

Slot "key":
[1] "dummy2"


[[5]]
An object of class "Interval"
Slot "start":
[1] -1.1

Slot "end":
[1] 1.2

Slot "key":
[1] "dummy4"


[[6]]
An object of class "Interval"
Slot "start":
[1] 1.1

Slot "end":
[1] 1.2

Slot "key":
[1] "dummy1"


list()

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