Learn R Programming

TraMineR (version 1.1)

seqecontain: Event sequence contains event

Description

Check if a sequence or a subsequence contains a specific event

Usage

seqecontain(seq, eventList, exclude = FALSE)

Arguments

seq
A list of event sequences or a list of subsequences
eventList
A list of events
exclude
if TRUE the search is exclusive and returns FALSE for any subsequence containing an event that is not in eventList

Value

  • A logical vector

Details

Checks, for each provided event sequence, if it contains an event in eventList. If exclude is TRUE, seqecontain looks if all events of the subsequence are in eventList.

Examples

Run this code
data(actcal.tse)
actcal.seqe <- seqecreate(actcal.tse)

##Searching for frequent subsequences, that is appearing at least 20 times
fsubseq <- seqefsub(actcal.seqe,minSupport=20)

##looking for subsequence with FullTime
seqecontain(fsubseq,c("FullTime"))

Run the code above in your browser using DataLab