interval_union: Finds the union between two unions of intervals.

Description Usage Arguments Details Value Examples

View source: R/domain.R

Description

Finds the union between two unions of intervals.

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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 April 28, 2020, 1:06 a.m.