countones | R Documentation |
countones used in apply to count number of ones in a vector
countones(invect)
invect |
vector of values |
A single value of zero or the number of ones
## Not run:
set.seed(12346)
x <- trunc(runif(10)*10)
x
countones(x) # should be 2
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.