seqsubsn | R Documentation |
Computes the number of distinct subsequences in a sequence using Elzinga's algorithm.
seqsubsn(seqdata, DSS=TRUE, with.missing=FALSE)
seqdata |
a state sequence object as defined by the |
DSS |
if |
with.missing |
logical: should non-void missing values be treated as a regular state?
If |
The function first searches for missing states in the sequences and if found, adds the missing state to the alphabet for the extraction of the distinct subsequences. A missing state in a sequence is considered as the occurrence of an additional symbol of the alphabet, and two or more consecutive missing states are considered as two or more occurrences of the same state. The with.missing=TRUE
argument is used for calling the seqdss
function when DSS=TRUE
.
Vector with the number of distinct subsequences for each sequence in the input state sequence object.
Alexis Gabadinho (with Gilbert Ritschard for the help page)
seqdss
.
data(actcal)
actcal.seq <- seqdef(actcal,13:24)
## Number of subsequences with DSS=TRUE
seqsubsn(actcal.seq[1:10,])
## Number of subsequences with DSS=FALSE
seqsubsn(actcal.seq[1:10,],DSS=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.