seqifpos.Rd
Returns the first position in each state.
seqifpos(seqdata)
a sequence object (see seqdef
function).
Gabadinho, A., G. Ritschard, N. S. Müller and M. Studer (2011). Analyzing and Visualizing State Sequences in R with TraMineR. Journal of Statistical Software 40(4), 1-37.
data(trajact)
seqact <- seqdef(trajact)
#> [>] 6 distinct states appear in the data:
#> 1 = 1
#> 2 = 2
#> 3 = 3
#> 4 = 4
#> 5 = 5
#> 6 = 6
#> [>] state coding:
#> [alphabet] [label] [long label]
#> 1 1 1 1
#> 2 2 2 2
#> 3 3 3 3
#> 4 4 4 4
#> 5 5 5 5
#> 6 6 6 6
#> [>] 500 sequences in the data set
#> [>] min/max sequence length: 37/37
stat <- seqifpos(seqact)
head(stat)
#> fpos1 fpos2 fpos3 fpos4 fpos5 fpos6
#> 1 NA 1 NA NA NA NA
#> 2 1 25 6 NA NA NA
#> 3 1 5 32 NA 15 NA
#> 4 1 5 NA NA NA 7
#> 5 1 7 NA NA NA NA
#> 6 1 7 NA NA 11 NA