R/getRidgeLength.R

"getRidgeLength" <-
function(ridgeList, Th=0.5) {

	ridgeLen <- sapply(ridgeList, function(x) {
		m <- max(x)
		l <- length(x)
		while(l > 1) {
			if (x[l] > m * Th) break
			l <- l - 1
		}
		return(l)
	} )
	return(ridgeLen)
}

Try the MassSpecWavelet package in your browser

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

MassSpecWavelet documentation built on Nov. 8, 2020, 5:36 p.m.