R/seqgbar.R

Defines functions seqgbar

## ========================================================
## Creates a vector of 0 and 1 used for plotting a sequence
## ========================================================

seqgbar <- function(seq, statl, seql) {

	nbstat <- length(statl)
	
	gbar <- vector("integer", seql*nbstat)

	for (j in 1:seql)
		gbar[((j-1)*nbstat)+which(statl==seq[j])] <- 1

	return(gbar)
}
	

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.