powered by
The S4 class "interval" is a simple class for numeric intervals.
class
"interval"
"maybeInterval" is a class union (see setClassUnion) of "interval" and "NULL".
"maybeInterval"
setClassUnion
"NULL"
Objects can be created by calls of the form new("interval", ...), but typically they are built via interval().
new("interval", ...)
interval()
.Data
numeric vector of length two, specifying the interval ranges.
open
logical vector of length two, specifying if the interval is open or closed on the left and right, respectively.
logical
Class "interval" extends "numeric", from data part, and "maybeInterval", directly.
"numeric"
signature(x = "numeric", table = "interval"): check if x is inside the interval, carefully differentiating open and closed intervals.
signature(x = "numeric", table = "interval")
x
signature(x = "interval"): ...
signature(x = "interval")
signature(object = "interval"): ...
signature(object = "interval")
signature(x = "interval"): Group methods, notably range(), min(), etc.
range()
min()
interval constructs "interval" objects conveniently.
interval
-1:2 %in% interval("(0, Inf)") ## 0 is *not* inside
Run the code above in your browser using DataLab