subseq
among the event sequences and returns the result according to the selected method
.seqeapplysub(subseq, method = NULL, constraint = NULL,
rules=FALSE)
seqefsub
"count"
, "presence"
or "age"
subseq
. See seqeconstraint
TRUE
, instead of checking occurrences of the subsequences among the event sequences, check the occurrence of the subsequences inside the subsequences (internally used by seqerules
)"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.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.## 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]
Run the code above in your browser using DataLab