R/Mode.r

Defines functions Mode

Documented in Mode

Mode<-function(x){
x<-na.omit(x)
step1<-as.factor(x)
m<-summary(step1)
m1<-which(m==max(m))
if(all(m==1)) print("No mode")
else
as.numeric(names(m1))}

Try the asbio package in your browser

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

asbio documentation built on Aug. 20, 2023, 9:07 a.m.