Learn R Programming

TraMineR (version 1.6-2)

seqelength: Length of event sequences

Description

The length of an event sequence is its time span, i.e. the total time of observation. This information is optional but may be useful to perform for instance a survival analysis. seqelength retrieves the length the given sequences. seqesetlength sets the length of the sequences.

Usage

seqelength(s)
seqesetlength(s,len)

Arguments

s
An event sequence object (seqelist).
len
A list of sequence lengths.

Value

  • seqelength returns 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