seqelength | R Documentation |
The length of an event sequence is its time span, i.e., the total time of observation. This information is useful to perform for instance a survival analysis. The function
seqelength
retrieves the lengths of the provided sequences, while
seqelength <-
sets the length of the sequences.
seqelength(eseq, s)
seqelength(eseq, s) <- value
eseq |
An event sequence object ( |
value |
A list of sequence lengths. |
s |
Deprecated. Use |
A numeric vector with the lengths of the sequences.
Matthias Studer (with Gilbert Ritschard for the help page)
data(actcal.tse)
actcal.eseq <- seqecreate(actcal.tse)
## Since end.event is not specified, contains no sequence lengths
## We set them manually as 12 for all sequences
sl <- numeric()
sl[1:2000] <- 12
seqelength(actcal.eseq) <- sl
actcal.eseq[1:10]
## Retrieve lengths
slen <- seqelength(actcal.eseq)
summary(slen)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.