interval_union: Finds the union between two unions of intervals.

View source: R/domain.R

interval_unionR Documentation

Finds the union between two unions of intervals.

Description

Finds the union between two unions of intervals.

Usage

interval_union(A, B)

Arguments

A

A list of vectors of size 2, each representing an interval. It is required that A[[i]][1] <= A[[i]][2] <= A[[j]][1] for any i < j.

B

A list of vectors of size 2, each representing an interval. It is required that A[[i]][1] <= A[[i]][2] <= A[[j]][1] for any i < j.

Details

Finds the union between the union of all intervals in A and the union of all intervals in B.

Value

A list of vectors of size 2, whose union represents the union between A and B.

Examples

interval_union(list(c(1.2,1.5), c(2.3,2.7)),
       list(c(0.6,1.4), c(2.5,3.6), c(6.3,6.9)))
interval_union(list(c(-0.3,0.55), c(2.35,2.8)),
       list(c(0.54,0.62), c(2.5,2.9)))
interval_union(list(c(0,1)), list(c(1,2)))
interval_union(list(c(0,1-1e-8)), list(c(1,2)))
interval_union(list(c(0,1), c(2,3)),
       list(c(1,2)))
interval_union(list(c(0,1-1e-8), c(2+1e-8,3)),
       list(c(1,2)))
interval_union(list(c(0,1)), list())

genscore documentation built on May 29, 2024, 9 a.m.