seqlength {TraMineR} | R Documentation |
Returns the length of sequences.
seqlength(seqdata)
seqdata |
a sequence object created with the seqdef function. |
The length of a sequence is computed by eliminating the missing values at the end (right) and counting the number of states or events. The seqlength function returns a vector containing the length of each sequence in the sequence object given as argument.
## Loading the 'famform' example data set data(famform) ## Defining a sequence object with the 'famform' data set ff.seq <- seqdef(famform) ## Retrieving the length of the first 10 sequences ## in the ff.seq sequence object seqlength(ff.seq)