Learn R Programming

IntervalSurgeon (version 1.3)

flatten: Flatten a set of intervals

Description

For a given set of intervals compute the set of intervals where there is overlap with at least one from the given. The resulting intervals are sorted and detached.

Usage

flatten(x)

Value

Intervals represented by integer matrix of two columns.

Arguments

x

Integer matrix of two columns, the first column giving the (inclusive) start points of intervals and the second column giving the corresponding (exclusive) end points.

Examples

Run this code
flatten(rbind(c(1, 3), c(2, 4), c(5, 6)))

Run the code above in your browser using DataLab