Mode of a distribution

I am trying to find the mode of various distributions contained in waves (as in, the most frequently occurring value). I don't see that there is an obvious command in Igor Pro 5.05A to find this but maybe I'm missing it. Is there any way to find the mode easily within Igor? Thanks!
ap
Could you calculate a Histogram and then look for the maximum with WaveStats?
Beside the command line both operations can be accessed via Igor's Analysis menu.
A.
A neat stats trick is to use something called the "shorth":
DF Andrews, “Robust Estimates of Location.” Princeton University Press (1972).

This can be implemented in Igor as follows:
function shorth(data,alpha)
    wave data
    variable alpha
   
    duplicate /free data,sorted
    sort data,sorted
    variable n=numpnts(data)
    alpha*=n
    make /o/n=(n/2) shorths=sorted[p+alpha]-sorted[p]
    wavestats /q/m=1 shorths
    variable meann=mean(sorted,v_minloc,v_minloc+n/2)
    return meann
end


Alpha=0.5 is the typical choice. This code then finds the mean of the data in the shortest interval that contains half the data. So it is robust against modes that are not the main mode. This does not return the mode per se, but it is an estimator that asymptotically approaches the mode, and summarizes the data a little bit more cleanly in my opinion.

Rick