Learn R Programming

dst (version 1.8.0)

nameRows: Combining the column names of a matrix to construct names for the rows

Description

This function determines the name of a row from all the columns of the tt that show 1 for that row.

Usage

nameRows(tt, f)

Value

A character vector of labels obtained for the rows of the tt matrix. The length of the result is nrow(tt).

Arguments

tt

A (0,1)-matrix or a boolean matrix.

f

Deprecated. Old name for tt matrix.

Author

Claude Boivin

Details

The row containing only 1s is called "frame", to avoid too long a label. The empty set is identified by its code "u00f8". The "+" sign is used to represent the logical "or" operator. The space " " is used to represent the logical "and" operator. Note that in the case of a product space defined on many variables, row labels can become very long.

Examples

Run this code
tt <- matrix(c(0,0,0,1,0,0,0,0,1,1,0,1,1,1,1),ncol = 3, byrow = TRUE)
colnames(tt) <- c("A","B","C")
rownames(tt) <-nameRows(tt)
tt

Run the code above in your browser using DataLab