nonoverlapping: Compute overlaps of two sets of detached and sorted intervals

Description Usage Arguments Value Examples

Description

Find intervals satisfying particular conditions, including corresponding base R functions intersect (i.e. find intersections of intervals), union (i.e. unions of intervals) and setdiff (i.e. finding intervals which are contained in one set of intervals but not another).

Usage

1
2
3
4
5
6
7
overlaps(x, y, check = TRUE, in_x = TRUE, in_y = TRUE, op = "and")

intersects(x, y, ...)

unions(x, y, ...)

setdiffs(x, y, ...)

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.

y

Same as x.

check

Boolean value determining whether to check that the intervals specified in arguments x and y are sorted and non-overlapping (uses function detached_sorted_nonempty). Defaults to TRUE, but setting to FALSE may allow faster execution.

in_x

Boolean value determining whether to flag TRUE on intervals contained in x.

in_y

Boolean value determining whether to flag TRUE on intervals contained in y.

op

Character value specifying operator used to combine flags for each interval, either "and" or "or".

...

Additional arguments to be passed to overlaps.

Value

Intervals represented by integer matrix of two columns.

Examples

1
2
3
intersects(cbind(1, 3), cbind(2, 4))
setdiffs(cbind(1, 3), cbind(2, 4))
unions(cbind(1, 3), cbind(2, 4))

IntervalSurgeon documentation built on June 16, 2018, 1:36 p.m.