toPersonPeriod: Converting into person-period format.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/toPersonPeriod.R

Description

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

Usage

1
toPersonPeriod(seqdata)

Arguments

seqdata

A state sequence object as returned by seqdef.

Value

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

Author(s)

Matthias Studer

See Also

seqformat .

Examples

1
2
3
4
5
6
7
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,])

Example output

Loading required package: TraMineR

TraMineR stable version 2.0-7 (Built: "Sat,)
Website: http://traminer.unige.ch
Please type 'citation("TraMineR")' for citation information.

TraMineRextras stable version 0.4.1 (Built: 2017-09-21)
Functions provided by this package are still in test
    and subject to changes in future releases.
 [>] state coding:
       [alphabet]  [label]  [long label] 
     1  FE          EM       employment
     2  HE          FE       further education
     3  employment  HE       higher education
     4  joblessness JL       joblessness
     5  school      SC       school
     6  training    TR       training
 [>] 712 sequences in the data set
 [>] min/max sequence length: 72/72

TraMineRextras documentation built on June 25, 2021, 1:06 a.m.