count_if: Count TRUE Values in a Logical Vector

View source: R/RcppExports.R

count_ifR Documentation

Count TRUE Values in a Logical Vector

Description

This function counts the number of TRUE values in a logical vector, with an option to remove missing values.

Usage

count_if(x, na_rm = FALSE)

Arguments

x

A logical vector.

na_rm

Logical flag indicating whether to remove NA values before counting (default is false).

Value

An integer representing the number of TRUE values in the vector.


ChristK/CKutils documentation built on April 11, 2025, 10:11 p.m.