quantify | R Documentation |
Returns the number of elements from an iterable object that
evaluate to TRUE
.
quantify(obj, ...)
obj |
an iterable object |
... |
further arguments passed to iteror. |
the number of TRUE
elements
reduce
it <- iteror(c(TRUE, FALSE, TRUE))
quantify(it) # 2
set.seed(42)
x <- sample(c(TRUE, FALSE), size=10, replace=TRUE)
quantify(x) # Equivalent to sum(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.