Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

seqentrans

Event sequence length and number of events


Description

Adds the sequence length (number of transitions) and total number of events of event sequences to the data attribute of a subseqelist event sequence object.

Usage

seqentrans(fsubseq, avg.occ = FALSE)

Arguments

fsubseq

A subseqelist object as returned by seqefsub.

avg.occ

Logical: Should a column with average number of occurrences also be added?

Details

An event sequence object is an ordered list of transitions, with each transition a non-ordered list of events occurring at a same position.

Average occurrences by sequence may be useful when counts report number of occurrences rather than number of sequences containing the subsequence.

Value

The object fsubseq updated with the additional information.

Author(s)

Nicolas Müller and Gilbert Ritschard

Examples

data(actcal.tse)
actcal.seqe <- seqecreate(actcal.tse[1:500,])

##Searching for frequent subsequences appearing at least 30 times
fsubseq <- seqefsub(actcal.seqe, min.support=10)
fsubseq <- seqentrans(fsubseq)
## dispaying only those with at least 3 transitions
fsubseq[fsubseq$data$ntrans>2]
## dispaying only those with at least 3 events
fsubseq[fsubseq$data$nevent>2]

## Average occurrences when counting distinct occurrences
ct <- seqeconstraint(count.method="CDIST_O")
fsb <- seqefsub(actcal.seqe, min.support=10, constraint=ct)
fsb <- seqentrans(fsb, avg.occ=TRUE)
fsb[1:10,]

TraMineRextras

TraMineR Extension

v0.6.1
GPL (>= 2)
Authors
Gilbert Ritschard [aut, cre, ths, cph] (<https://orcid.org/0000-0001-7776-0903>), Matthias Studer [aut] (<https://orcid.org/0000-0002-6269-1412>), Reto Buergin [aut], Tim Liao [ctb], Alexis Gabadinho [ctb], Pierre-Alexandre Fonta [ctb], Nicolas Muller [ctb], Patrick Rousset [ctb]
Initial release
2021-01-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.