Learn R Programming

QCA (version 1.0-4)

createMatrix: Create Configuration and Implicant Matrices

Description

This function creates configuration and implicant matrices. Note that it is mainly used internally. Proper truth tables should be created with truthTable. Proper implicant matrices should be created with allExpressions.

Usage

createMatrix(noflevels, logical = FALSE)

Arguments

noflevels
The number of levels for each condition
logical
Logical, return the matrix in logical values (only binary-level crisp data)

Details

Configuration matrices contain all unique Boolean products of $k$ literals that can be formed from $k$ conditions. The total number of configurations is given by the product of the number of condition levels. createMatrix() should be among the fastest functions to create truth table structures, optimising ideas inspired from the base R function expand.grid(). The implicant matrix consists of all configurations and their supersets, including the empty set. The formula for the number of implicants is $\prod_{j = 1}^{k}{p_j + 1}$, where $p_j$ is the number of levels for condition $j$ and $k$ is the number of conditions.

References

A. Dusa. A Mathematical Approach to the Boolean Minimization Problem. Quality & Quantity, 44(1):99-113, 2010. A. Dusa. Enhancing Quine-McCluskey. WP 2007-49, COMPASSS, 2007. URL: http://www.compasss.org/wpseries/Dusa2007b.pdf. C. C. Ragin. The Comparative Method: Moving beyond Qualitative and Quantitative Strategies. University of California Press, Berkeley, 1987.

See Also

allExpressions truthTable

Examples

Run this code
# create a configuration matrix with 3 binary-level conditions
noflevels <- rep(2, 3)
createMatrix(noflevels)

# its implicant matrix, where "-1" stands for an eliminated condition
createMatrix(noflevels + 1) - 1

# create a configuration matrix, where the second condition has three levels 
noflevels <- c(2, 3, 2)
createMatrix(noflevels)

# its implicants matrix
createMatrix(noflevels + 1) - 1

Run the code above in your browser using DataLab