Hi,
df <- data.frame(matrix(c(1,2,3,4,4,1,2,4,4,4),ncol=5, byrow=TRUE))
df
X1 X2 X3 X4 X5
1 1 2 3 4 4
2 1 2 4 4 4
I'm sure there is an easy answer, but I can't come up with it. How do I count the number of 4's in row 1? How do I count the number of 4's in row 2?