if (require("QCA")) {
translate("A + B*C")
# same thing in multivalue notation
translate("A{1} + B{1}*C{1}")
# using upper/lower letters
translate("A + b*C")
# the negation with tilde is recognised
translate("~A + b*C")
# even in combination of upper/lower letters
translate("~A + ~b*C")
# and even for multivalue variables
translate("~A{1} + ~B{0}*C{1}")
# in multivalue notation, the product sign * is redundant
translate("C{1} + T{2} + T{1}V{0} + C{0}")
# multiple values can be specified
translate("C{1} + T{1,2} + T{1}V{0} + C{0}")
# or even negated
translate("C{1} + ~T{1,2} + T{1}V{0} + C{0}")
# if the expression does not contain the product sign *
# snames are required to complete the translation
translate("AB + cD", "A, B, C, D")
# snames are not required
translate("PER*FECT + str*ing")
# snames are required
translate("PERFECT + string", "PER, FECT, STR, ING")
# it works even with overlapping columns
# SU overlaps with SUB in SUBER, but the result is still correct
translate("SUBER + subset", "SU, BER, SUB, SET")
## Not run:
# # error because combinations of condition names clash
# translate("SUPER + subset", "SUP, ER, SU, PER, SUB, SET")
# ## End(Not run)
# to print _all_ codes from the standard output matrix
(obj <- translate("A + b*C"))
print(obj, original = TRUE) # also prints the -1 code
# for compute()
data(CVF)
compute("natpride + GEOCON", data = CVF)
# calculating individual paths
compute("natpride + GEOCON", data = CVF, separate = TRUE)
# for findRows()
data(LC)
ttLC <- truthTable(LC, "SURV", show.cases = TRUE)
findRows("DEV*ind*STB", ttLC)
findRows("DEV*ind*STB", ttLC, remainders = TRUE)
}
Run the code above in your browser using DataLab