Learn R Programming

TraMineR (version 1.8-9)

seqlength: Sequence length

Description

Returns the length of sequences.

Usage

seqlength(seqdata)

Arguments

seqdata
a sequence object created with the seqdef function.

Details

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.

Examples

Run this code
## 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)

Run the code above in your browser using DataLab