Learn R Programming

IntervalQuestionStat (version 0.2.0)

as.IntervalData: Convert a real number into a degenerate interval

Description

This function allows to coerce a real number stored as a single numeric object to a degenerate interval formed only by this real number saved as an IntervalData instance.

Usage

# S4 method for numeric
as.IntervalData(object)

Value

This function returns a degenerate interval saved as an object of class IntervalData.

Arguments

object

A single real number stored as a single numeric object.

Author

José García-García garciagarjose@uniovi.es

Details

Single real numbers could be seen as particular cases of interval-valued data where each interval's lower and upper bounds are equal or, alternatively, its spread is zero.

See Also

Other coercion function is as.IntervalList().

Examples

Run this code
## Transform a single real-valued number into an interval
## In particular, degenerate interval {1} is defined.
i <- as.IntervalData(1); i

Run the code above in your browser using DataLab