It seems that there are already many streams of "peaks in density", but I do not see anyone specifically address this issue. Sorry, if you missed it, repeat it.
My problem: for a vector of 1000 values ββ(an example is attached), I would like to identify the peaks in the histogram or the data density function. From the image of the data below, I see peaks in the histogram at values ββof 0, 6200 and 8400. But I need to get the exact values ββof these peaks, preferably a simple procedure, since I have several thousand of these vectors to process.

I initially started working with the histogram outputs themselves, but could not get the peak search command to work correctly (for example, not at all). I'm not even sure how to get the peaks command () from the splus2R package to work with a histogram object or a density object. This would still be my preference, since I would like to determine the exact value of the maximum frequency of each peak (as opposed to the value of the density function, which is slightly different), but I also can not understand what one of them is.
I would publish sample data myself, but I see no way to do it here (sorry if I just skipped it).
source share