Skip to content
Prev 369677 / 398503 Next

[FORGED] Problem related to rowSums

On 07/06/17 21:08, Yogesh Gupta wrote:

            
(1) You should probably have a *matrix*, not a data frame.

(2) Have you ever heard of the idea of providing a *reproducible* example?

(3) I *think* the following may be what you want/need:

M <- as.matrix(M) # Where the initial M is your "data frame".
sum(apply(M,1,function(x){isTRUE(all.equal(x,rep(0,length(x))))}))

Untested, since you did not supply a reproducible example.

cheers,

Rolf