R/countModes.R

Defines functions countModes

#counts the number of modes in a vector based on significant curvature
countModes <- function(x,...){
 y<-featureSignif(x, bw=bw.nrd(x), ...)
 count<-0
 for (i in 2:length(y$curv)){
   if (y$curv[i]==1 && y$curv[i-1]==0)
     count<-count+1
 }
 return(list(density=y, NumberOfModes=count))
}

Try the flowMeans package in your browser

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

flowMeans documentation built on Nov. 8, 2020, 4:51 p.m.