powered by
countgtone used in the base function 'apply', or 'tapply' to count the number > 1 in a vector
countgtone(invect)
vector of values
the number of values in the vector > 1
# NOT RUN { x <- matrix(trunc(runif(20)*10),nrow=4,ncol=5) print(x) apply(x,1,countgtone) # }
Run the code above in your browser using DataLab