Skip to content
Prev 86458 / 398513 Next

Inf values in a matrix

Ita.Cirovic-Donev at hypo-alpe-adria.com wrote:

            
Example:

  A <- matrix(1:100, 10)
  A[cbind(3:4, 5:6)] <- Inf
  recorded <- which(apply(A, 1, function(x) any(is.infinite(x))))
  A[-recorded,]


Uwe Ligges