count_if | R Documentation |
This function returns the number of observations that meet a condition. This is a simple wrapper function for which
and length
designed to increase code readability and reduce code length.
count_if(condition, ...)
condition |
A logical vector. |
... |
Additional arguments (none currently implemented). |
A number which defines the number of elements in a vector which meet the condition specified.
Edward Lavender
x <- c(1, 2, 4, 4, 3)
count_if(x < 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.