Returns a vector containing the position of the first occurrence of the given element in each of the sequences in the data set.
seqfpos(seqdata, state)
a sequence object (see seqdef
function).
the state element to search in the sequences
Alexis Gabadinho
the state to search for has to be passed as a character string, and must be one of the state returned by the alphabet
function. If the state is not contained in a sequence, NA is returned for this sequence.
data(biofam)
biofam.seq <- seqdef(biofam,10:25)
## Searching for the first occurrence of state 1
## in each of the 5 first sequence of the biofam data set.
seqfpos(biofam.seq[1:5,],"1")
Run the code above in your browser using DataLab