Learn R Programming

TraMineR (version 1.1)

seqelength: Length of event sequences

Description

The length of event sequence correspond to the total time of observation of the corresponding individual. This information is optional but can be used to perform survival analysis. seqelength can be used to retrieve the length of some sequences. seqesetlength can be used to set the length of these sequences.

Usage

seqelength(s)
seqesetlength(s,len)

Arguments

s
A list of sequences.
len
A list of time corresponding to each sequences.

Value

  • seqelength return a numeric vector with the length of each sequences.

Examples

Run this code
data(actcal.tse)
actcal.seqe <- seqecreate(actcal.tse)
##time to end is added
sl <- numeric()
sl[1:2000] <- 12
##All sequences with same length
seqesetlength(actcal.seqe, sl)
actcal.seqe[1:10]
##Retrieve length
seqelength(actcal.seqe)

Run the code above in your browser using DataLab