title: Report all possible combinations of columns
body: <p>I have a question regarding combinations generally, but in a fairly complex situation which I have not yet been able to find any help on. I am trying to find a way to report all possible combinations of <em>columns</em> in a dataset.</p>
  
  <p>The data report on a literature survey of land change, and indicate which proximate and underlying drivers are reported in each article. Thus, the rows indicate individual articles, and the columns all proximate and underlying drivers. There are six types of proximate drivers and five types of underlying drivers. For each article, a 1 is placed in the columns of the drivers identified in that article, and a 0 in the columns of the drivers that are not. The table looks roughly like so:</p>
  
  <pre><code>key | d1 | d2 |...| d6 | i1 |...| i5 |
  --------------------------------------
  A1  | 1  | 0  |...| 1  | 1  |...| 0  |
  A2  | 0  | 1  |...| 0  | 0  |...| 1  |
  </code></pre>
  
  <p>Where article A1 identifies d1 and d6 as direct drivers and i1 as an indirect driver, etc.</p>
  
  <p>What I would like to do is find out the number of articles reporting each of all possible combinations of direct drivers, indirect drivers, and direct and indirect drivers. So, for instance, how many articles identify d1, d2, and i1; how many identify d1, d2, and i2; and so on? My students have the table in an Excel file, and I was thinking that perhaps Calc or Base might have a function to automate the process. Does anyone have an idea as to how I could do this?</p>
  
  <p>Thank you!</p>