title: Counting subset membership co-occurrences and group alphabet length
body: <p>Is there a way in R to count patterns of state co-occurrences in sequences, i.e., to work on groups where element order is not necessarily important? The purpose would be to find out how common are the occurrences of the larger sub-groups within even longer groups.</p>
  
  <p>For example, the input data set would be something like this ('real' data sequences would be  up to ~10 columns wide and 1000s rows deep) ...</p>
  
  <pre><code>a,b,c,d
  b,c,d,a
  c,d,b,a
  a,b,c,d,e
  b,c,d,a,e
  a,b,c
  ...
  </code></pre>
  
  <p>and the result would perhaps show...</p>
  
  <pre><code>abcd, abcd*  
  </code></pre>
  
  <p>as a set or class, with a count to indicate number of occurrences, with e.g. * indicating a subset or 'membership elsewhere' category and score based on <code>length()</code>.</p>
  
  <p>The results would also show...</p>
  
  <pre><code>abcde
  </code></pre>
  
  <p>as a different and slightly rarer set or class, with a higher score reflecting longer <code>length()</code>.</p>
  
  <p>And finally ...</p>
  
  <pre><code>abc*
  </code></pre>
  
  <p>would have a higher count score, but lower <code>length()</code> score.</p>
  
  <p>Something like Traminer that works on unordered (disordered?) groups would be excellent. I note there may be issues with computational load, but I'll consider that (i.e. some sort of triviality threshold) if I need to cut my teeth writing a program.</p>