Unsupervised sequence identification
You may use ngrams to get the frequent sequences of you events.

Here a little example

 library(tau)
 seq &lt;- "ababcdcde"
 textcnt(seq, method="ngram", n=3L, decreasing=TRUE)

   _   a  ab   b   c  cd   d  _a _ab aba abc  ba bab  bc bcd cdc cde  dc dcd  de de_   e  e_ 
   2   2   2   2   2   2   2   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1


Select the longest and most frequent ngram, here ab and cd.
You may also trade off the length and frequency to get maximal compression. The n parameter limits the length of the ngram.