I have a matrix of values some of which are -Inf. How can I find the smallest value that is greater than -Inf?
This way:
foo <- matrix(c(1,2,-Inf,3),nrow=2,ncol=2) min(foo[foo>-Inf]) [1] 1