Learn R Programming

tableMatrix (version 0.82.0)

getRowDim.tableMatrix: Get row dimensions

Description

tableMatrix method to get row dimensions from matDim attribute.

Usage

# S3 method for tableMatrix
getRowDim(obj, i = NULL, repo = NULL, ...)

Arguments

obj

tableMatrix object.

i

Integer. Row index in tab.

repo

Numeric vector. Vector with 2 elements - matN and matRow.

...

Passed arguments.

Value

Dimensions corresponding to the row.

Examples

Run this code
# NOT RUN {
data(images8By8)
data(images10By10)

# Create tableMatrix from images8By8 and images10By10
TM <- tableMatrix(list(images8By8, images10By10), 
list(r=c(1,3), r=c(1,3)),
list(r=c(4,ncol(images8By8)),r=c(4,ncol(images10By10))),list(c(8,8),c(10,10)),
dimNames =c("dimX", "dimY"))
matDim(TM)
tab(TM) 

# Dimensions corresponding to row 1 in tab(TM)
getRowDim(TM, 1)

# Dimensions corresponding to row 91 in tab(TM)
getRowDim(TM, 91)

# Dimensions corresponding to row 1 in second matrix in mat(TM)
getRowDim(TM, repo=c(2,1))

# }

Run the code above in your browser using DataLab