Learn R Programming

TraMineRextras (version 0.6.8)

toPersonPeriod: Converting into person-period format.

Description

Converts the STS sequences of a state sequence object into person-period format.

Usage

toPersonPeriod(seqdata)

Value

A data frame with three columns: id, state and timestamp.

Author

Matthias Studer

Arguments

seqdata

A state sequence object as returned by seqdef.

See Also

seqformat .

Examples

Run this code
data(mvad)
mvad.labels <- c("employment", "further education", "higher education",
    "joblessness", "school", "training")
mvad.scodes <- c("EM", "FE", "HE", "JL", "SC", "TR")
mvad.seq <- seqdef(mvad, 15:86, states = mvad.scodes, labels = mvad.labels)

mvad2 <- toPersonPeriod(mvad.seq[1:20,])

Run the code above in your browser using DataLab