Learn R Programming

dst (version 1.3.0)

productSpace: 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 values of the variables put in relation are set side by side, as in a truth table.

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 only by 0 or 1. 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.

Examples

Run this code
# NOT RUN {
 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")) )
productSpace(tt=ttfw, specnb=specfw, infovar=infovarfw)
# }

Run the code above in your browser using DataLab