So I am trying to sum the rows of a matrix, and there are inf\'s within it. How do I sum the row, omitting the inf\'s?
This is a "non-apply" and non-destructive approach:
rowSums( matrix(match(A, A[is.finite(A)]), nrow(A)), na.rm=TRUE) [1] 2 4
Although it is reasonably efficient, it is not as fast as Johsua's multiplication method.