Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8768555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:05:57+00:00 2026-06-13T17:05:57+00:00

There seem to be a lot of peaks in density function threads already, but

  • 0

There seem to be a lot of “peaks in density function” threads already, but I don’t see one addressing this point specifically. Sorry to duplicate if I missed it.

My problem: Given a vector of 1000 values (sample attached), I would like to identify the peaks in the histogram or density function of the data. From the image of the sample data below , I can see peaks in the histogram at ~0, 6200, and 8400. But I need the obtain the exact values of these peaks, preferably in a simple procedure as I have several thousand of these vectors to process.

Hist and Density Function

I originally started working with the histogram outputs themselves, but couldn’t get any peak-finding command to work properly (like, not at all). I’m not even sure how it would get the peaks() command from the splus2R package to work on histogram object or on a density object. This would still be my preference, as I would like to identify the exact data value of the max frequency of each peak (as opposed to the density function value, which is slightly different), but I can’t figure that one out either.

I would post the sample data themselves, but I can’t see a way to do that on here (sorry if I’m just missing it).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:05:58+00:00Added an answer on June 13, 2026 at 5:05 pm

    If your y values are smooth (like in your sample plot), this should find the peaks pretty repeatably:

    peakx <- x[which(diff(sign(diff(y)))==-2)]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that there are lot's of questons on this, but all seem to
there seem to be a lot of threads here asking similar questions, but I'm
There seem to be many questions asked about this subject here on stackoverflow, but
I've done a lot of searching and there seem to be similar issues, but
I've looked all around, and there seem to be a lot of hacks, but
There seem to be a number of different ways in which one can create
I googled how to turn a div into a link but there seem to
There does not seem to be a lot of information on the Custom Map
I've been looking around for a solution to this, and there seem to be
There seem to be a lot of new NoSQL type databases out there. Some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.