intersect4interval: computes the interval intersection of two intervals

Description Usage Arguments Value Examples

View source: R/f2.rbsb3.code.r

Description

computes and returns the interval (vector of length 2 or 0) which is the intersection of two given intervals.
Null intervals are indicated by rbsb.num0.

Usage

1
intersect4interval(int1, int2)

Arguments

int1

The first interval (numeric(2) or numeric(0)).

int2

The second interval (numeric(2) or numeric(0)).

Value

A numeric(2) or numeric(0) providing the intersection of the two input intervals.

Examples

1
2
3
4
5
 rbsb3k("RESET"); # needed only for R checking, to be forgotten
 intersect4interval(numeric(0), 1:2);
 intersect4interval(c(1, 10), c(-3, 5));
 intersect4interval(c(1, 10), c(10, 12));
 intersect4interval(c(1, 10), c(11, 12));

rbsb documentation built on May 2, 2019, 4:41 p.m.