properties {matrixset}R Documentation

Matrixset properties

Description

Utility functions to extract relevant information from a matrixset object.

Usage

## S3 method for class 'matrixset'
dim(x)

## S3 method for class 'matrixset'
dimnames(x)

## S3 replacement method for class 'matrixset'
dimnames(x) <- value

matrixnames(x)

matrixnames(x) <- value

matrix_elm(x, matrix)

matrix_elm(x, matrix) <- value

nmatrix(x)

row_traits(x)

column_traits(x)

row_traits(x) <- value

column_traits(x)

column_traits(x) <- value

row_tag(x)

column_tag(x)

row_info(x)

row_info(x) <- value

column_info(x)

column_info(x) <- value

is_matrixset(x)

Arguments

x

matrixset object from which to retrieve information, or object to test for being a matrixset.

value

valid value for replacement

matrix

index specifying matrix or matrices to extract. Index is numeric or character vectors or empty (NULL). Note that treating NULL as empty differs from the usual extraction, where it is treated as integer(0). Here a NULL (empty) results in selecting all matrices.

Details

ìs_matrixset tests if its argument is a proper matrixset object.

dim retrieves the dimension of the matrixset matrices (which are the same for reach). Similarly,nrow returns the number of rows for each matrices, and ncol returns the number of columns.

dimnames retrieves the dimnames of the matrixset matrices (which are the same for reach). Similarly, rownames (colnames) will retrieve row (column) names.

matrixnames retrieves the matrix names, or NULL if the matrices are not named.

nmatrix returns the number of matrices of a matrixset.

row_traits returns the object's row traits; these are the column names of the row annotation data frame.

column_traits returns the object's column traits; these are the column names of the column annotation data frame.

row_info extracts the row annotation data frame. column_info does the same thing for column annotation.

row_tag returns the column name of row_info that stores the matrixset's row names. column_tag returns the column name of column_info that stores the matrixset's column names.

The replacement methods for row_traits/row_info and column_traits/column_info can potentially change meta variables that were used for grouping. There is always an attempt to keep the original groups, but they will be updated if it is possible - a message is issued when that happens - and otherwise removed altogether, with a warning.

matrix_elm extracts a single matrix. It's a wrapper to x[,,matrix], but returns the matrix element. The replacement method matrix_elm is also a wrapper to ⁠x[,,matrix] <-⁠.

Value

ìs_matrixset returns a logical.

dim returns a length-2 vector; nrow and ncol return length-1 vector.

dimnames returns a length-2 list; one component for each dimnames (row and column). rownames and colnames each returns a character vector of names.

matrixnames acharacter vector of matrix names, or NULL.

nmatrix returns an ìnteger.

row_traits and column_traits returns a character vector.

row_tag and column_tag returns a character vector.

row_info extracts the row annotation data frame. column_info does the same thing for column annotation.

Examples

is_matrixset(student_results)
dim(student_results)
c(nrow(student_results), ncol(student_results))
dimnames(student_results)
list(rownames(student_results), colnames(student_results))
matrixnames(student_results)
nmatrix(student_results)
list(row_traits(student_results), column_traits(student_results))
row_info(student_results)
column_info(student_results)


[Package matrixset version 0.3.0 Index]