ncol {IntervalQuestionStat}R Documentation

Get the number of columns of an IntervalMatrix object

Description

This function allows to get the number of columns of an interval-valued matrix.

Usage

## S4 method for signature 'IntervalMatrix'
ncol(x)

Arguments

x

A matrix of interval-valued data stored as an IntervalMatrix object.

Value

This function returns a single numeric value indicating the number of columns of an interval-valued matrix. Therefore, this function always returns an integer object whose length is one.

Author(s)

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

See Also

The number of columns of an IntervalMatrix object can be obtained along with the number of rows through dim() function. In an analogous way, for getting the number of rows of an IntervalMatrix object, nrow() function can be used.

Examples

## Some ncol() examples

data1 <- matrix(c(0, 1, 2, 3, 0, 3, 4, 9), 2, 4)
m1 <- IntervalMatrix(data1)
ncol(m1)
data2 <- matrix(c(1, 5, 3, 2, 6, 4, 0, 1, 3,
                  2, 3, 9, 4, 3, 7, 5, 6, 8), 3, 6)
m2 <- IntervalMatrix(data2)
ncol(m2)

[Package IntervalQuestionStat version 0.2.0 Index]