I am looking for the best method to go from a sequence of events such astime event1 a2 b3 a4 b5 c6 d7 c8 d9 eWhere 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 ewhere 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 sequenceingwith edgeR. But I have no experience in this so I was hoping that someone canshed me some light on a common approach for this type of problems.
Unsupervised sequence identification
feature extraction;sequence
You may use ngrams to get the frequent sequences of you events.Here a little example library(tau) seq <- 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   1Select 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.