countNAs | R Documentation |
countNAs used in the base function 'apply', or 'tapply' to count the number of NAs in a vector
countNAs(invect)
invect |
vector of values |
A single value of zero or the number of NAs
x <- matrix(trunc(runif(20)*10),nrow=4,ncol=5)
diag(x) <- NA
print(x)
apply(x,1,countNAs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.