How can a I automatically build a matrix, that converts permutations of a `vector <- c(1,2,3)` into kind of a binary format? Like this: 

```
x <- matrix(c(1,1,0,0,0,1,0,1,1,0,1,1,0,0,0,1,1,1), ncol = 3)
rownames(x) <- c("1", "1,2", "2", "3", "2,3", "1,2,3")
colnames(x) <- c("1", "2", "3")

x
      1 2 3
1     1 0 0
1,2   1 1 0
2     0 1 0
3     0 0 1
2,3   0 1 1
1,2,3 1 1 1

```

Though I would like to have not 3, but 7 values.