# simple PI chart, formatted using internal function prettyTable()
PI <- c("A", "B", "c", "D")
CO <- c("AbCD", "AbCd", "aBcd", "aBCD")
chart <- demoChart(PI, CO)
prettyTable(chart)
# solution:
# first or third PI: A + c
solveChart(chart)
# all non-overlapping solutions:
# first or third PI: A + c
# second or third or fourth PI: B + c + D
solveChart(chart, all.sol = TRUE)
# a more complex example
PI <- c("AB", "BC", "Ac", "aC", "abd", "bcd")
CO <- c("ABCD", "ABCd", "ABcD", "ABcd", "AbcD", "Abcd",
"aBCD", "aBCd", "abCD", "abCd", "abcd")
chart <- demoChart(PI, CO)
prettyTable(chart)
# AB + Ac + aC + abd
# AB + Ac + aC + bcd
# BC + Ac + aC + abd
# BC + Ac + aC + bcd
solveChart(chart)
Run the code above in your browser using DataLab