Re: [R] basic array question

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
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.

Example:

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

Uwe Ligges

> Tim
>
> ______________________________________________
> 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



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 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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.