[R] which.minimums not which.min

From: Fred J. <phddas_at_yahoo.com>
Date: Thu 16 Mar 2006 - 06:32:07 EST


  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] 11
>
   

  but I need
  which.min(x) to be 5 11
  which.max(x) to be 4 10    

  thanks       


        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Mar 16 07:08:50 2006

This archive was generated by hypermail 2.1.8 : Thu 16 Mar 2006 - 09:09:17 EST