count_if: Count if function

View source: R/count_if.R

count_ifR Documentation

Count if function

Description

This function allows counting of single elements or all elements in a vector in a given data set.

Usage

count_if(
  data, 
  value, 
  ifnot = FALSE
)

Arguments

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.

Examples

count_if(data, value = c(1:8))

samueltobler/behavdata documentation built on July 9, 2024, 11:33 a.m.