Learn R Programming

TraMineR (version 1.0)

seqLCP: Longest common prefix of two sequences.

Description

Returns the length of the longest common prefix of two sequences.

Usage

seqLCP(iseq, jseq)

Arguments

iseq
a sequence from a sequence object or a vector of states.
jseq
a sequence from a sequence object or a vector of states.

Examples

Run this code
data(famform)
famform.seq <- seqdef(famform)
## The LCP's length between sequences 1 and 2
## in the famform sequence object is 2
seqLCP(famform.seq[1,],famform.seq[2,])

Run the code above in your browser using DataLab