count_if: Count the number of observations that meet a condition

View source: R/count_if.R

count_ifR Documentation

Count the number of observations that meet a condition

Description

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.

Usage

count_if(condition, ...)

Arguments

condition

A logical vector.

...

Additional arguments (none currently implemented).

Value

A number which defines the number of elements in a vector which meet the condition specified.

Author(s)

Edward Lavender

Examples

x <- c(1, 2, 4, 4, 3)
count_if(x < 2)


edwardlavender/utils.add documentation built on Dec. 14, 2024, 8:11 a.m.