stitch: Stich together touching intervals and remove empty intervals

View source: R/functions.R

stitchR Documentation

Stich together touching intervals and remove empty intervals

Description

Given an integer matrix specifying disjoint intervals sorted by start position, merge intervals with matching start and ends, and remove intervals of length zero.

Usage

stitch(x)

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.

Value

Intervals represented by integer matrix of two columns.

Examples

stitch(cbind(1:2, 2:3))

IntervalSurgeon documentation built on April 15, 2023, 5:07 p.m.