interval_operators: Interval operators

Description Usage Arguments Value Examples

Description

Operators to check if values are inside continuous (half) open and closed sets.

Usage

1
2
3
4
5
6
7
x %[]% y

x %()% y

x %(]% y

x %[)% y

Arguments

x

An atomic vector.

y

An atomic vector of length 2 containing the limits of a continous set.

Value

The operators return an atomic vector of class logical with the same length as x.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
4 %[]% c(4, 6)
3 %[]% c(4, 6)
4 %(]% c(4, 6)
6 %(]% c(4, 6)
4 %[)% c(4, 6)
6 %[)% c(4, 6)
6 %()% c(4, 6)
5 %()% c(4, 6)
Sys.time() %()% (Sys.time() + c(0, 1) * 60)
Sys.Date() %[]% c("2020-01-01", "2020-12-31")
set.seed(29)
2 %()% range(rnorm(100))

kaldhusdal/moreoperators documentation built on June 29, 2020, 12:54 a.m.