R/seqcomp.R

Defines functions seqcomp

Documented in seqcomp

## =======================
## Comparing two sequences
## =======================

seqcomp <- function(x, y) {

	lx <- seqlength(x)		
	ly <- seqlength(y)

	if (lx!=ly) 
		return(FALSE)
	else	if (sum(x[1:lx]==y[1:ly])==lx) 
		return(TRUE)
	else 
		return(FALSE)
}	

Try the TraMineR package in your browser

Any scripts or data that you put into this service are public.

TraMineR documentation built on Sept. 19, 2023, 1:07 a.m.