Say I have a list (a, b, c
), I Want to find out all the possible combinations of them and store in a matrix like:
a b c
[1,] 1 0 0
[2,] 0 1 0
[3,] 0 0 1
[4,] 1 1 0
[5,] 1 0 1
[6,] 0 1 1
[7,] 1 1 1`
I don't know how to make it. Thanks for the help!