I am trying to work out for each row of a matrix how many columns have values greater than a specified value. I am sorry that I am asking this simple question but I wasn\'t
We can also do with Reduce and + (assuming there are no NA elements)
Reduce
+
Reduce(`+`, lapply(as.data.frame(data), `>`, 30))
This should be efficient as we are not converting to a matrix.
matrix