[R] multiple peaks in data frame

Gabor Grothendieck ggrothendieck at myway.com
Thu Nov 27 00:00:40 CET 2003


Not entirely sure what you need.  

This gives data greater than a certain level:

z <- c(23,4,56,7,99)
z[z>20]
or
z[z>=median(z)]

This extracts points that are larger than the ones on either 
side:

zz <- c(-Inf,z,-Inf)
z[diff(sign(diff(zz)))<0]

---

Date: Wed, 26 Nov 2003 19:08:50 -0300 (ART) 
From: <solares at unsl.edu.ar>
To: <R-help at stat.math.ethz.ch> 
Subject: [R] multiple peaks in data frame 

 
 
Hello, it wanted to know how I can extract of a dates frame the values 
peaks according to an interval that I
establish. For example if dates are: 
1 23
2 4
3 56
4 7
5 99
6 33
extract the date i wanted to divide into intervals of 2 an
d to take alone the numbers 23, 56 and 99 of those 3 intervals. Thanks 
Ruben




More information about the R-help mailing list