R/TraMineR-mscore.R

Defines functions TraMineR.mscore

TraMineR.mscore <- function(seq, slength, statelist, freq) {
	mscore <- 0

	for (i in 1:slength) {
		si <- which(seq[i]==statelist)
		if (length(si)==1)
			mscore <- mscore+freq[si, i]
	}
	return(mscore)
}

Try the TraMineR package in your browser

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

TraMineR documentation built on Jan. 9, 2024, 3:02 p.m.