Checks occurrences of the subsequences
subseq among the event sequences and returns the result according to the selected
list of subsequences (an event subsequence object) such as created by
type of result, should be one of
Time constraints overriding those used to compute
If set to
There are three methods implemented:
"count" counts the number of occurrence of each given subsequence in each event sequence;
"presence" returns 1 if the subsequence is present, 0 otherwise;
"age" returns the age of appearance of each subsequence in each event sequence.
In case of multiple possibilities, the age of the first occurrence is returned. When the subsequence is not in the sequence, -1 is returned.
The return value is a matrix where each row corresponds to a sequence (row names are set accordingly) and each column corresponds to a subsequence (col names are set accordingly). The cells of the matrix contain the requested values (count, presence-absence indicator or age).
Matthias Studer and Reto Bürgin (alternative counting methods) (with Gilbert Ritschard for the help page)
Gabadinho, A., G. Ritschard, M. Studer and N. S. Müller (2009). Mining Sequence Data in
R with the
TraMineR package: A user's guide. Department of Econometrics and Laboratory of Demography, University of Geneva.
seqecreate for more information on event sequence object and Gabadinho et al. (2009) on how to use the event sequence analysis module.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
## Loading data data(actcal.tse) ## Creating the event sequence object actcal.seqe <- seqecreate(actcal.tse) ## Printing sequences actcal.seqe[1:10] ## Looking for frequent subsequences fsubseq <- seqefsub(actcal.seqe,pMinSupport=0.01) ## Counting the number of occurrences of each subsequence msubcount <- seqeapplysub(fsubseq,method="count") ## First lines... msubcount[1:10,1:10] ## Presence-absence of each subsequence msubpres <- seqeapplysub(fsubseq,method="presence") ## First lines... msubpres[1:10,1:10] ## Age at first appearance of each subsequence msubage <- seqeapplysub(fsubseq,method="age") ## First lines... msubage[1:10,1:10]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.