length {IntervalQuestionStat}R Documentation

Get the length of an IntervalList object

Description

This function allows to get the length of an interval-valued list, that is, the number of different nonempty compact real intervals stored in an IntervalList object.

Usage

## S4 method for signature 'IntervalList'
length(x)

Arguments

x

A list of nonempty compact real intervals stored as an IntervalList object.

Value

This function returns a single numeric value indicating the length of a list with several nonempty compact real intervals. Therefore, it always returns an integer object of whose length is one.

Author(s)

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

Examples

## Some length() examples

list1 <- IntervalList(c(0, 2, 5), c(1, 6, 10))
length(list1)

dataframe <- data.frame(mids = c(0.5, 4, 7.5, 5),
                        sprs = c(0.5, 2, 2.5, 1))
list2 <- IntervalList(dataframe, type = 2)
length(list2)

[Package IntervalQuestionStat version 0.2.0 Index]