Re: [R] which.minimums not which.min

2006-03-20 Thread Philippe Grosjean
Fred J. wrote: Philippe Grosjean [EMAIL PROTECTED] wrote: What Fred is looking for is local minima/maxima, also known as turning points, or pits/peaks in a series. You can look at ?turnpoints in pastecs library. x - c(1:4,0:5, 4, 11) x [1] 1 2 3 4 0 1 2 3 4 5 4 11

Re: [R] which.minimums not which.min

2006-03-16 Thread Fred J.
Philippe Grosjean [EMAIL PROTECTED] wrote: What Fred is looking for is local minima/maxima, also known as turning points, or pits/peaks in a series. You can look at ?turnpoints in pastecs library. x - c(1:4,0:5, 4, 11) x [1] 1 2 3 4 0 1 2 3 4 5 4 11 tp - turnpoints(x)

[R] which.minimums not which.min

2006-03-15 Thread Fred J.
Hi Is there a function which determines the location, i.e., index of the all minimums or maximums of a numeric vector. Which.min(x) only finds the (first) of such. x - c(1:4,0:5, 4, 11) x [1] 1 2 3 4 0 1 2 3 4 5 4 11 which.min(x) [1] 5 which.max(x) [1]

Re: [R] which.minimums not which.min

2006-03-15 Thread Christos Hatzis
Try order(x, decreasing=TRUE/FALSE) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fred J. Sent: Wednesday, March 15, 2006 2:32 PM To: r-help@stat.math.ethz.ch Subject: [R] which.minimums not which.min Hi Is there a function which

Re: [R] which.minimums not which.min

2006-03-15 Thread Marc Schwartz (via MN)
On Wed, 2006-03-15 at 11:32 -0800, Fred J. wrote: Hi Is there a function which determines the location, i.e., index of the all minimums or maximums of a numeric vector. Which.min(x) only finds the (first) of such. x - c(1:4,0:5, 4, 11) x [1] 1 2 3 4 0 1 2 3

Re: [R] which.minimums not which.min

2006-03-15 Thread Liaw, Andy
What you want seems to be the valleys and peaks in the data. If so, try: RSiteSearch(find peaks) which points to a post by Philippe Grosjean, pointing to the pastesc package: library(pastecs) Loading required package: boot tp - turnpoints(x) which(tp$peaks) [1] 4 10 which(tp$pits) [1]

Re: [R] which.minimums not which.min

2006-03-15 Thread Philippe Grosjean
What Fred is looking for is local minima/maxima, also known as turning points, or pits/peaks in a series. You can look at ?turnpoints in pastecs library. x - c(1:4,0:5, 4, 11) x [1] 1 2 3 4 0 1 2 3 4 5 4 11 tp - turnpoints(x) summary(tp) Turning points for: x nbr

Re: [R] which.minimums not which.min

2006-03-15 Thread Marc Schwartz (via MN)
On Wed, 2006-03-15 at 21:45 +0100, Philippe Grosjean wrote: What Fred is looking for is local minima/maxima, also known as turning points, or pits/peaks in a series. You can look at ?turnpoints in pastecs library. x - c(1:4,0:5, 4, 11) x [1] 1 2 3 4 0 1 2 3 4 5 4 11