Re: [R] basic array question

From: Uwe Ligges <>
Date: Fri 02 Jun 2006 - 18:26:44 EST

Tim Alcon wrote:
> I have a large array and would like to extract from it the row and
> column indices just of values for which a particular boolean condition

Do you mean a matrix, i.e. exactly 2 dimensions?

> is true. I assume there's a simple way to do this, but I haven't
> figured it out yet. Any help would be appreciated.


  X <- matrix(1:9, 3)
  col(X)[X == 4]
  row(X)[X == 4]

Uwe Ligges

> Tim
> ______________________________________________
> mailing list
> PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Fri Jun 02 18:30:36 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 02 Jun 2006 - 20:10:34 EST.

Mailing list information is available at Please read the posting guide before posting to the list.