Unsupervised sequence identification I am looking for the best method to go from a sequence of events such as

time event
1 a
2 b
3 a
4 b
5 c
6 d
7 c
8 d
9 e


Where each letter corresponds to a certain event that occurs at a time. I want to reduce the number of events by aggregating frequently occurring events into a new event. A possible solution data set would look like,

1 a'
2 a'
3 a'
4 a' 
5 b'
6 b'
7 b'
8 b'
9 e


where the clusters are created because they occur in a sequence following each other. 

I was looking at the text mining algorithms in R with tm or RNA sequenceing
with edgeR. But I have no experience in this so I was hoping that someone can
shed me some light on a common approach for this type of problems.
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.