Learn R Programming

gtx (version 0.0.8)

mincover: Compute minimum size of cover of overlapping intervals.

Description

Compute minimum size of cover of overlapping intervals.

Usage

mincover(x.begin, x.end)

Arguments

x.begin
a vector of interval begin positions.
x.end
a vector of interval end positions.

Value

An integer, the total size covered by the union of all intervals.

Examples

Run this code
mincover(c(1, 5, 10, 11, 22), c(8, 17, 13, 19, 25))
## first to fourth intervals all overlap
## third interval 10:13 entirely inside second interval 5:17

Run the code above in your browser using DataLab