Skip to content
Prev 77669 / 398502 Next

R: extracting elements in a matrix

you could try this:

mat <- matrix(rnorm(100 * 10), 100, 10)

ind <- apply(mat, 2, function(x){
    iqr <- diff(quantile(x, probs = c(0.25, 0.75)))
    x[x > 2 * iqr]
})


I hope it helps.

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.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Frank Schmid" <frank.schmid at vwi.unibe.ch>
To: <r-help at stat.math.ethz.ch>
Sent: Thursday, September 22, 2005 11:23 AM
Subject: [R] R: extracting elements in a matrix
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm