Re: [R] peak finding

From: Christos Hatzis <christos.hatzis_at_nuverabio.com>
Date: Mon, 24 Mar 2008 23:48:27 -0400

John,

There is a peak finding algorithm attributed to Prof. Ripley in the R-help archive. It has a span parameter which might give you something close to what you seem to be looking for.

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/33097.html

-Christos

> -----Original Message-----
> From: r-help-bounces_at_r-project.org
> [mailto:r-help-bounces_at_r-project.org] On Behalf Of Research Scholar
> Sent: Monday, March 24, 2008 11:24 PM
> To: Bill.Venables_at_csiro.au
> Cc: r-help_at_r-project.org
> Subject: Re: [R] peak finding
>
> Hi
> Thanks for replying. I meant x[4] is the start of a peak
> shape and x[14] is the end of that peak and x[9] is the
> maxima of the peak.
> Thanks,
> John
>
>
>
>
> On Mon, Mar 24, 2008 at 11:09 PM, <Bill.Venables_at_csiro.au> wrote:
>
> > It's hard to see how positions 4 and 14 correspond to 'peaks', they
> > look like troughs to me. So perhaps this is what you mean:
> >
> > > x <- c(14,15,12,11,12,13,14,15,16,15,14,13,12,11,14,12)
> >
> > > y <- which(x == min(x))
> > > y
> > [1] 4 14
> >
> > as a function:
> >
> > somefunction <- function(x) which(x == min(x))
> >
> >
> > Bill Venables
> > CSIRO Laboratories
> > PO Box 120, Cleveland, 4163
> > AUSTRALIA
> > Office Phone (email preferred): +61 7 3826 7251 Fax (if absolutely
> > necessary): +61 7 3826 7304
> > Mobile: +61 4 8819 4402
> > Home Phone: +61 7 3286 7700
> > mailto:Bill.Venables_at_csiro.au
> >
http://www.cmis.csiro.au/bill.venables/
> >
> > -----Original Message-----
> > From: r-help-bounces_at_r-project.org
> > [mailto:r-help-bounces_at_r-project.org]
> > On Behalf Of Research Scholar
> > Sent: Tuesday, 25 March 2008 12:54 PM
> > To: r-help_at_r-project.org
> > Subject: [R] peak finding
> >
> > Hi all
> > Is there a function that can find the start and end
> position of peaks
> > in a set of numbers.
> > eg.
> > x <- c(14,15,12,11,12,13,14,15,16,15,14,13,12,11,14,12)
> > y <- somefunction(x)
> >
> > y
> > 4 14
> >
> >
> > Thanks
> > John
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help_at_r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> >
> http://www.R-project.org/posting-guide.html<http://www.r-project.org/p
> > osting-guide.html> and provide commented, minimal, self-contained,
> > reproducible code.
> >
> >
> >
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 25 Mar 2008 - 03:50:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 25 Mar 2008 - 15:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive