Is there a R function to count the values more than 0 in a row
test <- data.frame(a=c(a,"y"),b=c(0,"5"),c=c(2,"0"))
test
a b c
1 1 0 2
2 y 5 0
I need to get following, because first row contains 1 values more than 0 and second row contains 1 value more than 0. I need to exclude first column as it is only character
test
a b c d
1 a 0 2 1
2 y 5 0 1