View source: R/matrixToMarray.R
matrixToMarray | R Documentation |
The matrix representation of a relation is converted to the array representation or product space representation.
matrixToMarray(tt, valuenames)
tt |
A (0,1)-matrix or a boolean matrix establishing the relation between two or more variables. The matrix is constructed by placing the variables side by side, as in a truth table representation. |
valuenames |
A list of the names of the variables with the name of each value of their frame of discernment. |
mtt The array (product space) representation of the tt
matrix.
Claude Boivin
# Define wr_tt, a matrix describing the relation between two variables
wr_tt <- matrix(c(1,rep(0,3),rep(c(1,0),3),0,1,1,1,0,0,
1,0,rep(1,5),0,1,1,0,rep(1,5)), ncol=4, byrow = TRUE)
colnames(wr_tt) <- c("Wy Ry", "Wy Rn", "Wn Ry", "Wn Rn")
rownames(wr_tt) <- nameRows(wr_tt)
vars = list( RdWorks = c("Wy", "Wn") , Rain = c("Ry", "Rn"))
print(zmToa <- matrixToMarray(tt = wr_tt, valuenames = vars ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.