count_if | R Documentation |
This function allows counting of single elements or all elements in a vector in a given data set.
count_if(
data,
value,
ifnot = FALSE
)
data |
Data input, e.g., as vector |
value |
Values of the elements to be counted, either one value or vector of values |
ifnot |
Specifies whether the value to be tested is true or not. Default = FALSE. ifnot = TRUE would count how many times the data set is not the value of interest. |
count_if(data, value = c(1:8))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.