Re: [R] Finding indexes of minum and maximum elements of an array

2010-12-27 Thread Phil Spector
Here's one way: H = array(c(8:5,1:4),dim=c(2,2,2)) which(H==min(H),arr.ind=TRUE) dim1 dim2 dim3 [1,]112 which(H==max(H),arr.ind=TRUE) dim1 dim2 dim3 [1,]111 - Phil Spector Statis

Re: [R] Finding indexes of minum and maximum elements of an array

2010-12-27 Thread Duncan Murdoch
On 10-12-27 5:26 PM, Eduardo de Oliveira Horta wrote: Hello there I wish to get the "coordinates" of the minimum element of an array. For example, if the array were H = array(c(8:5,1:4),dim=c(2,2,2)) H , , 1 [,1] [,2] [1,]86 [2,]75 , , 2 [,1] [,2] [1,]1

[R] Finding indexes of minum and maximum elements of an array

2010-12-27 Thread Eduardo de Oliveira Horta
Hello there I wish to get the "coordinates" of the minimum element of an array. For example, if the array were > H = array(c(8:5,1:4),dim=c(2,2,2)) > H , , 1 [,1] [,2] [1,]86 [2,]75 , , 2 [,1] [,2] [1,]13 [2,]24 then > min(H) [1] 1 and > max(H) [1]