Skip to content
Prev 86453 / 398513 Next

Inf values in a matrix

try the following:

mat <- matrix(rnorm(40), 10, 4)
mat[sample(20, 5)] <- Inf
mat
##########
index <- rowSums(!is.finite(mat)) >= 1
mat. <- mat[!index, ]

which(index)
mat.


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/(0)16/336899
Fax: +32/(0)16/337015
Web: http://www.med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: <Ita.Cirovic-Donev at hypo-alpe-adria.com>
To: <r-help at stat.math.ethz.ch>
Sent: Tuesday, February 14, 2006 5:01 PM
Subject: [R] Inf values in a matrix
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm