Re: [R] Regarding which.max()

2009-07-02 Thread Henrique Dallazuanna
Try this: which(x %in% max(x)) Then yuo can use, max or tail for get the last value. On Thu, Jul 2, 2009 at 4:30 PM, Kenny D'Amica wrote: > Hello, > > > > I'm currently writing a program to analyze economic indicators, and need > to identify the indices of peaks and troughs in certain interval

[R] Regarding which.max()

2009-07-02 Thread Kenny D'Amica
Hello, I'm currently writing a program to analyze economic indicators, and need to identify the indices of peaks and troughs in certain intervals (business cycles) of my time series. I am using which.max() for this, which gives me the index of the first max in the interval. However, I need a f