matrixExclusionTuples: Create item exclusion tuples from matrix.

Description Usage Arguments Details Value Examples

View source: R/matrixExlusionTuples.R

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

1

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

1
2
3
4
5
6
7
8
9
# 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)

eatATA documentation built on July 6, 2021, 5:07 p.m.