Learn R Programming

QCA (version 2.6)

factorize: Factorize Boolean expressions

Description

This function finds all combinations of common factors in a Boolean expression written in SOP - Sum Of Products form.

Usage

factorize(expression, snames = "", noflevels, pos = FALSE, tilde, ...)

Arguments

expression

A string containing the SOP expression, or an object of class "qca".

snames

A string containing the sets' names, separated by commas.

noflevels

Numerical vector containing the number of levels for each set.

pos

Logical, if possible factorize using product(s) of sums.

tilde

Logical, use a tilde to negate the expression.

...

Other arguments (mainly for backwards compatibility).

Value

A list with two components:

initial The input expression.
factored All possible factorizations of the input expression.

Details

Factorization is a process of finding common factors in a Boolean expression, written in DNF - disjunctive normal form, or in a sum of products (SOP) form. The factorization is also possible using products of sums (POS) form, whenever possible.

Starting with version 2.1 of the package, a number of arguments have been deprecated. For example, prod.split, because intersections (products) are indicated by the standard * sign, and sometimes products are not indicated by anything (for example when the set names are single letters.

The argument snames is only needed when products are not indicated by any sign at all, and the set names have more than one letter each (see function translate() for more details).

The number of levels in noflevels is needed only when negating multivalue conditions, and it should complement the snames argument.

If expression is an object of class "qca" (the result of the eqmcc() minimization function), this function performs a factorization for each of the minimized solutions.

References

Ragin, C.C. (1987) The Comparative Method. Moving beyond qualitative and quantitative strategies, Berkeley: University of California Press

See Also

translate

Examples

Run this code
# NOT RUN {
# results presented in alphabetical order
factorize("one*TWO*four + one*THREE + THREE*four")

# to preserve a certain order of the set names
factorize("one*TWO*four + one*THREE + THREE*four",
          snames = "ONE, TWO, THREE, FOUR")

factorize("~ONE*TWO*~FOUR + ~ONE*THREE + THREE*~FOUR",
          snames = "ONE, TWO, THREE, FOUR")

# using pos - products of sums
factorize("a*c + a*D + b*c + b*D", pos = TRUE)


# using an object of class "qca" produced with eqmcc()
data(CVF)
pCVF <- eqmcc(CVF, outcome = "PROTEST", incl.cut = 0.8,
              include = "?", use.letters = TRUE)

factorize(pCVF)

# }
# NOT RUN {
# using an object of class "deMorgan" produced with deMorgan()
factorize(deMorgan(pCVF))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab