apply(my.matrix, 1, FUN = function(x) {min(x[x > 0])})
-2
votes
This variation on your approach works for me:
apply(my.matrix, 1, FUN=function(x) {min(x>0)})
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more