Skip to content
Prev 68719 / 398506 Next

finding cols and rows in a matrix

check this:

mat <- matrix(rnorm(5*5), 5, 5)
mat[1, 3] <- 1; mat[4, 2] <- 2
####
which(mat==1, TRUE)
which(mat==2, TRUE)


Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "javier garcia" <rn001 at cebas.csic.es>
To: <r-help at stat.math.ethz.ch>
Sent: Thursday, April 28, 2005 12:55 PM
Subject: [R] finding cols and rows in a matrix