productSpace {dst}R Documentation

Product space representation of a relation

Description

This utility function takes the input matrix of a relation between two or more variables and yields its product space representation.

Usage

productSpace(tt, specnb, infovar)

Arguments

tt

A (0,1) or boolean matrix, where the variables are set side by side, as in a truth table. Each variable has a number of columns equal to the number of possible values.

specnb

A vector of integers ranging from 1 to k, where k is the number of subsets of the tt matrix. Values must start at one and can be increased by 1 or not. They determine the partitioning of the rows of the tt matrix between the k subsets.

infovar

A two-column matrix containing identification numbers of the variables and the number of elements of each variable (size of the frame).

Value

The matrix of the product space representation of the relation.

Author(s)

Claude Boivin

Examples

 ttfw <- matrix(c(1,0,1,0,0,1,0,1,1,1,1,1),nrow = 3,
  byrow = TRUE, 
  dimnames = list(NULL, c("foul", "fair", "foul", "fair")) )
 specfw <- c(1,1,2) 
 infovarfw <- matrix(c(5,7,2,2), ncol = 2, 
 dimnames = list(NULL, c("varnb", "size")) )
 rownames(ttfw) <- nameRows(ttfw)
 ttfw
productSpace(tt = ttfw, specnb = specfw, infovar = infovarfw)

[Package dst version 1.6.0 Index]