[R] peaks

Petr Pikal petr.pikal at precheza.cz
Wed May 30 13:31:12 CEST 2001


I have posted similar question few weeks ago and I have got a short 
response from prof. Ripley. I transformed it into this function:

peaks_function(series,span=3)
{
z <- embed(series, span)
result_max.col(z) == 1 + span %/% 2
result
}


Seems to work for vectors and ts.

Best regards.

Petr Pikal
0641 25 2258
0724 008 364
petr.pikal at precheza.cz
p.pik at volny.cz

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list