I would like to count all combinations in a data.frame.
The data look like this
9 10 11 12
1 1 1 1 1
2 0 0 0 0
3 0 0 0 0
4 1 1 1 1
5 1 1 1 1
6 0 0 0 0
7 1 0 0 1
8 1 0 0 1
9 1 1 1 1
10 1 1 1 1
The output I want is simply
comb n
1 1 1 1 5
0 0 0 0 3
1 0 0 1 2
Do you know any simple function to do that ?
Thanks
dt = structure(list(`9` = c(1, 0, 0, 1, 1, 0, 1, 1, 1, 1), `10` = c(1,
0, 0, 1, 1, 0, 0, 0, 1, 1), `11` = c(1, 0, 0, 1, 1, 0, 0, 0,
1, 1), `12` = c(1, 0, 0, 1, 1, 0, 1, 1, 1, 1)), .Names = c("9",
"10", "11", "12"), class = "data.frame", row.names = c(NA, -10L
))