matrixExclusionTuples {eatATA}R Documentation

Create item exclusion tuples from matrix.

Description

If item exclusions are stored as a matrix, matrixExclusionTuples transforms this format into item pairs ('tuples'). Information on exclusions has to be coded as 1 (items are exclusive) and 0 (items are not exclusive).

Usage

matrixExclusionTuples(exclMatrix)

Arguments

exclMatrix

A data.frame or matrix with information on item exclusiveness.

Details

Exclusion tuples can be used by itemExclusionConstraint to set up exclusion constraints.

Value

A data.frame with two columns.

Examples

# Example data.frame
exclDF <- data.frame(c(0, 1, 0, 0),
                     c(1, 0, 0, 1),
                     c(0, 0, 0, 0),
                     c(0, 1, 0, 0))
rownames(exclDF) <- colnames(exclDF) <- paste0("item_", 1:4)

# Create tuples
matrixExclusionTuples(exclDF)



[Package eatATA version 1.1.2 Index]