interval: Construct Simple "interval" Object

View source: R/Auxiliaries.R

intervalR Documentation

Construct Simple "interval" Object

Description

Easy construction of an object of class interval, using typical mathematical notation.

Usage

interval(ch)

Arguments

ch

a character string specifying the interval.

Value

an interval object.

See Also

the interval class documentation, notably its reference to more sophisticated interval classes available for R.

Examples

interval("[0, 1)")

## Two ways to specify open interval borders:
identical(interval("]-1,1["),
          interval("(-1,1)"))

## infinite :
interval("[0, Inf)")

## arithmetic with scalars works:
4 + 2 * interval("[0, 1.5)") # ->  [4, 7)

## str() to look at internals:
str( interval("[1.2, 7]") )

copula documentation built on Sept. 11, 2024, 7:48 p.m.