R/rowmode.R

Defines functions rowmode

Documented in rowmode

## returns the modal value of a variable
## author: Gilbert Ritschard

rowmode <- function(v, except = NULL) {
	tt <- table(v)
	tt <- tt[!(names(tt) %in% except)]
	return(names(tt)[which.max(tt)])
}

Try the TraMineRextras package in your browser

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

TraMineRextras documentation built on Sept. 11, 2024, 6:52 p.m.