overlaps {IntervalSurgeon} | R Documentation |
Compute overlaps of two sets of detached and sorted intervals
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
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 |
check |
Boolean value determining whether to check that the intervals specified in arguments |
in_x |
Boolean value determining whether to flag |
in_y |
Boolean value determining whether to flag |
op |
Character value specifying operator used to combine flags for each interval, either |
... |
Additional arguments to be passed to |
Value
Intervals represented by integer matrix of two columns.
Examples
intersects(cbind(1, 3), cbind(2, 4))
setdiffs(cbind(1, 3), cbind(2, 4))
unions(cbind(1, 3), cbind(2, 4))